• 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: autopopulate country dropdown list

autopopulate country dropdown list 16 years 3 weeks ago #7044

  • morktron
  • morktron's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
Hi, i found the documentation here www.rsjoomla.com/customer-support/docume...st-from-a-table.html about how to auto populate a dropdown.
//<code>
$items = "|Please Select[c]\n";
$rez = mysql_query("SELECT your_value,your_label FROM your_table_here");
while($r = mysql_fetch_assoc($rez))
$items .= $r['your_value'] . '|' . $r['your_label'] . "\n";
return $items;
//</code>

This is fine if you are an accomplished coder but unfortunately I am not.

I've attached a screenshot of my database showing the country list from VirtueMart.

your_table_here - would this be jos_vm_country?

your_label - what is this?

your_value - what is this?

Then do I put this code into 'Additional attributes' in RSForm Pro admin?

Thanks, this is quite exiting for me if it works!
Attachments:
Last Edit: 16 years 3 weeks ago by morktron. Reason: trying again
The administrator has disabled public write access.

Re:autopopulate country dropdown list 16 years 3 weeks ago #7045

  • morktron
  • morktron's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8


can't seem to attach an image!
The administrator has disabled public write access.

Re:autopopulate country dropdown list 16 years 3 weeks ago #7046

  • bogdan
  • bogdan's Avatar
  • NOW ONLINE
  • RSJoomla! Official Staff
  • Posts: 122
  • Thank you received: 4
Hello ,

Try this:
//<code>
$items = "|Please Select[c]\n";
$rez = mysql_query("SELECT country_id,country_name FROM #__vm_country");
while($r = mysql_fetch_assoc($rez))
$items .= $r['country_id'] . '|' . $r['country_name'] . "\n";
return $items;
//</code>
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here

RSJoomla! Development Team
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!