Hi, I'm trying to get a form submit working for all browsers, and I am using document.forms['formname'].submit().
However, despite having 'formname' set on the forms in both the name and id properties, Safari 3 will not submit the form correctly; when I debug, $_POST is empty. IE, FF both work here fine. I've also tried document.forms.formname.submit(), Safari doesn't seem to like that either.
If I use document.forms[0].submit() it works correctly, but this code will be working in a dynamic site where I can never be sure at what index a given form will reside.
I can make it work using document.getElementById('formname').submit(), but that does not work with js turned off, and I need this to work with js on/off.
I can't use a submit input, much as I would like to, the button is a three piece rounded-cornered, drop-shadowed graphic button where I have no idea how long the text displayed is, and it can be displayed in any of 9 languages.
Below is an example of the basic button, as you can see I want the form submit to be set on the outer wrapper div to ensure expected behavior:
Code:
<form name="choose_form" id="choose_form" action="/app/order/flow/processChoose/token/<?=$this->changeToken?>" method="post">
<div class="sc_btn_wrapper" id="sc_btn_wrapper_<?=$payId?>" onmouseover="gryBtnHover(1,'<?=$payId?>')" onmouseout="gryBtnHover(0,'<?=$payId?>')" onclick="document.forms['choose_frm'].submit()">
<div class="sc_btn_left"></div>
<div class="sc_btn_center">
<div id="sc_btn_text_<?=$payId?>" class="ch_btn_txt"><?=$payName?></div>
</div>
<div class="sc_btn_right"></div>
</div>
<input type="hidden" name="chooseButton<?=$payId?>" value="<?=$payName?>" />
</form>
Any ideas?
|