My source code is something like that:
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript" src="http://www.my_web_page.com//js/prototype-1.4.0.js"></script>
- <script>
- function showMoreOptions( url, pars, div_id ){
- if (document.getElementById(div_id).style.display=='block'){
- document.getElementById(div_id).style.display='none';
- } else {
- document.getElementById(div_id).style.display='block';
- var myAjax = new Ajax.Updater( {success: div_id}, url, { method: 'post', parameters: pars });
- }
- }
- </script>
- <form name="form_name" method="post" action="script.cgi">
- <table border="0" cellspacing="0" cellpadding="1" align="center">
- <tr><td><input type="checkbox" name="1" value="1"></td><td width="100%">Option 1</td></tr>
- <tr><td><input type="checkbox" name="2" value="2"></td><td width="100%">Option 2</td></tr>
- </table>
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr><td><a href="javascript:showMoreOptions('http://www.my_web_page.com', 'do=more_options', 'more');">More options</a></td></tr>
- <tr><td><div id="more" style="position:relative;display:none;"></div></td></tr>
- </table>
- </form>
Expand|Select|Wrap|Line Numbers
- <table border="0" cellspacing="0" cellpadding="1" align="center">
- <tr><td><input type="checkbox" name="3" value="3"></td><td width="100%">Option 3</td></tr>
- </table>
Everything works ok in explorer, but if the user works with firefox or safari the checkbox returned via ajax (the one in the div tag) is not sended to the cgi script. Is like if the checkbox wasn't into the form. Of course if I use the 'view source code' option in firefox and safari the div is empty. And if I make a list of the elements in the form using form.elements property using javascript the checkbox doesn't show up.
Someone knows why does it works with explorer and why it doesn't works using the other navigators?
Can you give me a solution?