_________________ 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 24, 2011 3:20 pm
Joined: Sun Jan 09, 2011 2:16 pm Posts: 56 Has thanked: 1 time Have thanks: 0 time
thank u bro.. bro one more question...here we are placing elements...what we suould if we want disappear that element by selecting another option...am using the following code but my problem is i get a new line because am using null as string value....is there any alternative to don't display that space
<script> function doSomething(){ if (form.someselect.options[form.someselect.selectedIndex].value=='female') { alert("male is option chose "); document.getElementById('mydiv').innerHTML = '' } } </script>
Question subject: Re: how to load the form elements depending on selection option
Posted: Mon Jan 24, 2011 6:31 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time
i don;t understand the problem clearly , which spaces .
_________________ 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: Wed Jan 26, 2011 4:24 pm
Joined: Sun Jan 09, 2011 2:16 pm Posts: 56 Has thanked: 1 time Have thanks: 0 time
msi_333 Bro..plz once check the following code so that u can understand it clearly ... the problem with this code is , when iam selecting 2 it gives the space(2 r 3 lines) above the address area and above submit button(3 r 4 lines)...,and when iam selecting 3 it gives the space above the submit button (5 or 6 lines of space) and by default (with out selecting any num) it gives the space above "ocp" selection(4 r 5 lines) and above "cat" selection,above address text area,marritalstatus(1 line each)..... So bro..plz suggest me a solution for this problem
in this function ,you have 3 case for value 1 and 2 and 3 , and in the last two cases (2,3) , you delete the html content of the div like : document.getElementById('dob1').innerHTML =''; document.getElementById('dob2').innerHTML =''; document.getElementById('bill1').innerHTML =''; document.getElementById('bill2').innerHTML =''; document.getElementById('ocp1').innerHTML ='';
so you have white lines .
_________________ 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: Thu Jan 27, 2011 3:01 pm
Joined: Sun Jan 09, 2011 2:16 pm Posts: 56 Has thanked: 1 time Have thanks: 0 time
Hi bro..is there any alternative for this problem? am also thought same for this problem as u said deleting html content.... but plz check this code also bro...in this also am deleting the html code and the page displayed well after changing the select option...in prev code there is a long gap between the elements of the output but here is not.... bro plz give me a solution???
Code:
<script> function doSomething(){ if (form.sel.options[form.sel.selectedIndex].value=='one') {