Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Safari and document.forms submit
Old 02-23-2009, 08:41 PM Safari and document.forms submit
Junior Talker

Posts: 4
Trades: 0
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?
vossie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-24-2009, 10:22 AM Re: Safari and document.forms submit
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
Impossible, basically.

How do you want to do something with JS when you account for the possibility that JS is off?
Only real possibility is getting another button.
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Safari and document.forms submit
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32193 seconds with 12 queries