Question subject: how to load the form elements depending on selection option
Posted: Thu Jan 13, 2011 4:56 pm
Joined: Sun Jan 09, 2011 2:16 pm Posts: 56 Has thanked: 1 time Have thanks: 0 time
hi friendz... Any body help on this...i want to create a page with some form elements(text,password,radio buttons,check boxes...etc).. and the problem is... the very first element in the form is a select option(its my requirement)...following some elements if i change the select option in the dropdown then the remaining all form elements or some of them should change....i.e it will display the different form elements depending on the select option any one help me on this with the code.....
Question subject: Re: how to load the form elements depending on selection option
Posted: Sun Jan 16, 2011 3:13 pm
Joined: Sun Jan 09, 2011 2:16 pm Posts: 56 Has thanked: 1 time Have thanks: 0 time
any one please will help on this?? how to add the elements to that page only when the java script on "select" option run...that is insted of displaying that massage in alert(in the above example) a message should be displayed there itself the page contain select scroll.... thank u in advance!!!
Question subject: Re: how to load the form elements depending on selection option
Posted: Sun Jan 16, 2011 9:03 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time
do u you want to show the error in a bar or something like that ?
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
saics
Question subject: Re: how to load the form elements depending on selection option
Posted: Mon Jan 17, 2011 12:39 pm
Joined: Sun Jan 09, 2011 2:16 pm Posts: 56 Has thanked: 1 time Have thanks: 0 time
no not like that... you are displaing that "male is option chose " in the alert window....but my desire is ti print that maeesge below the select ..that means the message should be displayed in that page only..
Question subject: Re: how to load the form elements depending on selection option
Posted: Tue Jan 18, 2011 9:53 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time
yes ,you can write anything as string .
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
For this message the author msi_333 has received gratitude : saics
saics
Question subject: Re: how to load the form elements depending on selection option
Posted: Sun Jan 23, 2011 2:53 pm
Joined: Sun Jan 09, 2011 2:16 pm Posts: 56 Has thanked: 1 time Have thanks: 0 time
hi msi_333 bro... one more doubt regarding this code...can't we insert the data in the table using <div>..tag Bro..jst watch the following code and give me a suggestion to place it in the table...
<script> function doSomething(){
if (form.someselect.options[form.someselect.selectedIndex].value=='male') { alert("male is option chose "); document.getElementById('mydiv').innerHTML = '<td>Name:</td><td><input type=text