laPistola Posted June 4, 2009 Share Posted June 4, 2009 function subCho() { var sS = document.getElementById('subject'); var sSt = sS.options[sS.selectedIndex].text; if (sSt=="Quote") { document.getElementById('rangeRow').innerHTML = '<td align="right"><label for="range">Range:</label></td><td> </td><td><select name="range" id="range"><option>AJAX</option></select> <label for="personallised">Personallised stationary?</label> <input type="checkbox" name="personallised" id="personallised" /></td>'; remAdd(); } else if (sSt=="Sample Request") { document.getElementById('rangeRow').innerHTML = '<td align="right"><label for="range">Range:</label></td><td> </td><td><select name="range" id="range"><option>AJAX</option></select></td>'; document.getElementById('ad1').innerHTML = '<td align="right"><label for="address1">Address:</label></td><td> </td><td><input name="address1" type="text" id="address1" size="30" /></td>'; document.getElementById('ad2').innerHTML = '<td align="right"><label for="address2"> </label></td><td> </td><td><input name="address2" type="text" id="address2" size="30" /></td>'; document.getElementById('ad3').innerHTML = '<td align="right"><label for="address3">City:</label></td><td> </td><td><input name="address3" type="text" id="address3" size="30" /></td>'; document.getElementById('pc').innerHTML = '<td align="right"><label for="postcode">Postcode:</label></td><td> </td><td><input name="postcode" type="text" id="postcode" size="10" /></td>'; } else { document.getElementById('rangeRow').innerHTML = ' '; remAdd(); } } function remAdd() { document.getElementById('ad1').innerHTML = ''; document.getElementById('ad2').innerHTML = ''; document.getElementById('ad3').innerHTML = ''; document.getElementById('pc').innerHTML = ''; } targets <tr height="0%" id="rangeRow"> </tr> <tr height="0%" id="ad1"> </tr> <tr height="0%" id="ad2"> </tr> <tr height="0%" id="ad3"> </tr> <tr height="0%" id="pc"> </tr> The above code works fine in FireFox 3 but in IE 7 it just says there is error on the page in the status bar at the bottom. This code below works great function otherBox() { var oS = document.getElementById('hear'); var oSt = oS.options[oS.selectedIndex].text; if (oSt=='Other') { document.getElementById('oB').innerHTML = '<label for="other">if other:</label> <input type="text" name="other" id="other" />'; } else { document.getElementById('oB').innerHTML = ' '; } } Targeting <em id="oB"> </em> What the code does is dependant on a drop down menu selection it show different fields. Any idea why its not working in IE ?? Quote Link to comment Share on other sites More sharing options...
laPistola Posted June 4, 2009 Author Share Posted June 4, 2009 I have marked as solved so no one wastes time in this thread, i made errors and it was to late to click the edit bottom (as its gone) as i have reposted with more details! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.