Selectbox values

Please find and discuss FAQs and JS/PHP samples here

Selectbox values

Postby monopeed » Sat Jan 15, 2011 4:39 am

Hi I'm new to javascript and trying to solve what to some of you guys may be very simple but I just can't seem to resolve it.

Using the Complex form as a template I want to make a small change. I've added the script below to help explain what I'm trying to do.

Basically all I want is to set different values to each of the tours. Currently if you select say Bulgaria Tour 1, 2 or 3 they all give the same value (500). How do I change it so if you select Tour 2 or 3 they have different values.

Any help would be much appreciated.

Thanks

function add_item(id,val,_obj) {
tmp=document.createElement("OPTION");
tmp.value=id;
tmp.text=val;
_obj.options.add(tmp);
}
function country_change(field) {
if (field.selectedIndex==0) {
while ({%id28}.options.length>0) {%id28}.remove(0);
add_item(0,'-- Please select --',{%id28});
add_item(1,'Bulgaria- tour 1',{%id28});
add_item(2,'Bulgaria- tour 2',{%id28});
add_item(3,'Bulgaria- tour 3',{%id28});
{%id31}.value='500';
} else
monopeed
 
Posts: 2
Joined: Thu Jun 10, 2010 6:45 pm

same problem

Postby pettipiere » Wed Apr 27, 2011 3:36 pm

I am trying to find an answer to this issue as well.

If anyone has a pointer please let me know.

Otherwise it will be time to learn fabrik!

Thanks

Chris
pettipiere
 
Posts: 1
Joined: Wed Apr 27, 2011 3:03 pm

Re: Selectbox values

Postby IToris team » Thu Nov 10, 2011 4:30 pm

Hello,

Please check this topic.

IToris Team
IToris team
Site Admin
 
Posts: 1685
Joined: Mon Jan 19, 2009 12:33 pm


Return to Smart Former

Who is online

Users browsing this forum: No registered users and 2 guests

cron