• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
form_dropdown()

#1
[eluser]BigJobbies[/eluser]
Hey Peoples,

Im having some problems with a script im writing and was wondering if someone could help me out, Im new to this whole CodeIgniter thing, so please be kind Smile

I have created a form with a dropdown box, but i want to be able to show / hide <div>'s based on what selection they choose on the dropdown ... I figure it has something to do with the onChange attribute, but cant quite figure it out.

This is what i have to create the dropdown box

Code:
&lt;? $dropdown_js = 'onchange=SomeFunction();"';?&gt;
&lt;?=form_dropdown('link_type',$link_types,$this->validation->link_type,$dropdown_js)?&gt;

This works fine, what i would like it to do though, is get the value of the selected item in the dropdown box, and have that as the div "id" so that if i choose something with the value of "name" it shows <div id="name"></div> and hides the rest.

If someone has made something like this, or know how i would get started, that would be most appreciated, i have been racking my brains to figure this one out, but im far from a wiz at javascript.

Thanks All.

Smile


Messages In This Thread
form_dropdown() - by El Forum - 06-23-2008, 10:42 PM
form_dropdown() - by El Forum - 06-23-2008, 11:44 PM
form_dropdown() - by El Forum - 06-23-2008, 11:48 PM
form_dropdown() - by El Forum - 06-23-2008, 11:50 PM
form_dropdown() - by El Forum - 06-23-2008, 11:55 PM
form_dropdown() - by El Forum - 06-24-2008, 01:30 AM
form_dropdown() - by El Forum - 06-24-2008, 03:51 AM
form_dropdown() - by El Forum - 06-24-2008, 06:15 AM
form_dropdown() - by El Forum - 06-24-2008, 09:09 AM
form_dropdown() - by El Forum - 06-24-2008, 09:19 AM
form_dropdown() - by El Forum - 06-24-2008, 09:22 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.