• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: renting DVD - autopopulate content_item title

renting DVD - autopopulate content_item title 17 years 2 months ago #1969

  • lenamtl
  • lenamtl's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
Hi,

I'm trying to create a DVD renting service using Rsform.

If I use RSform into Joomla content_item, how can I make the form autopopulate with the title of this content_item?

I have also tried to add the form into com_store content without success.

any suggestions are welcome.
The administrator has disabled public write access.

Re:renting DVD - autopopulate content_item title 17 years 2 months ago #1999

  • dniezby
  • dniezby's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 136
  • Thank you received: 2
I don't understand what you're trying to do?
Are you trying to just add a form to a page that already exists or are you trying to create a form that will be used as an order form.

If you're trying to create an eCommerce page for your site, I'd recommend you try Virtumart Component.

If you're trying to populate a field automatically with information already in the database, this is what you need to check:
From RSForm FAQs
How do I dinamically load data from Db inside a selectbox
Here's an example of how you can get the users and load them in a select box (field id = select):

1. Create a new field (field type = select box, field id = select). Leave the Default Value empty
2. Edit your form, go to Scripts and paste this code in Script called on form display :

$database->setQuery(\"SELECT username FROM #__users\"«»);
$data = $database->loadObjectList();//we load the usernames
 
foreach($fields as $i=>$field){
    if($field->name=='select'){//cycle through the fields, and find our select box field
        $string = array();
        if(!empty($data)){
            foreach($data as $data_row){
                $string[] = $data_row->username.'|'.$data_row->username;//prepare the default syntax which will be value1|label1,value2|label2
            }
        }
        $string = implode(',',$string);
        $fields[$i]->default_value = $string;
    }
}
<br><br>Post edited by: dniezby, at: 2008/02/19 19:33
Dave Niezby
www.nsfilms.com
Nightshade Studios, CEO
The administrator has disabled public write access.

Re:renting DVD - autopopulate content_item title 17 years 2 months ago #2092

  • lenamtl
  • lenamtl's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
Hi,

this is not what I want to do, I want to autopopulate a text field with the content_item title.

for example:

I put a rsform into content (using the mambot)
into the form I need a field autopopulated with the content title.

I need this to know from where the form was filled, this is important when using same form id on several content item.
The administrator has disabled public write access.

Re:renting DVD - autopopulate content_item title 17 years 2 months ago #2117

  • dniezby
  • dniezby's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 136
  • Thank you received: 2
OOOOh..

Ok, so you're using the same form on different pages of your site? So you're using the {mosforme #} plugin to embed the form?

Hmm...Well, what I would do is make multiple forms. This way you don't have to create any scripting to see what page the form was sent from.

It's easy to do.

Simply create your first form.
Create a hidden field (sentfrom) and assign it a default value. EG: home
Go to your list of completed forms, click the checkbox and select COPY from the menu.
Now go to your new form, rename it if you want but you change the default value of your hidden field to something else. EG: links page.

I suppose you could use several methods.
onChange scripts
on form submit scripts

I'd have to research it but it shouldn't be too hard to create a script that looks for the URL and publishes it.
You could try this but I think that it only captures the configured livesite url.

Create a hidden form field and call it \"sentfrom\"
in the default value put {jos_siteurl}

I haven't tried this method but it's something you could try. The only problem here is that I'm not sure if it will send that form's page url or the livesite url.
Dave Niezby
www.nsfilms.com
Nightshade Studios, CEO
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!