Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
auto submit a form, but there is a input[name="submit"] field...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
WenDong Zhang  
View profile  
 More options Jul 9 2009, 8:35 am
Newsgroups: mozilla.dev.ajax
From: WenDong Zhang <zwd2...@gmail.com>
Date: Thu, 9 Jul 2009 20:35:52 +0800
Local: Thurs, Jul 9 2009 8:35 am
Subject: auto submit a form, but there is a input[name="submit"] field...
Hi guys:

  I've met a weird use case. there is a form, and I want to auto submit when
the page loaded completed.
we can do it by FORM.SUBMIT()!  but, here I get a headache, there is a input
field whose name is 'submit'...
so when I use form.submit(), there is a error : form.submit() is not a
function (of course form.submit is the input node...)

    <form id="form1" action="/">
        <input type="text" name="submit" />
    </form>
<script type="text/javascript">
    var f = document.getElementById('form1');
    //console.log(f);
    //console.log(f.submit);
    f.submit();
</script>

so, I want to know is there another way to make the form auto submit

--
Best Regards!
Wen Dong


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Honnen  
View profile  
 More options Jul 9 2009, 9:25 am
Newsgroups: mozilla.dev.ajax
From: Martin Honnen <mahotr...@yahoo.de>
Date: Thu, 09 Jul 2009 15:25:09 +0200
Local: Thurs, Jul 9 2009 9:25 am
Subject: Re: auto submit a form, but there is a input[name="submit"] field...

You will need to rename that input first.

--

        Martin Honnen
        http://msmvps.com/blogs/martin_honnen/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
WenDong Zhang  
View profile  
 More options Jul 9 2009, 10:20 pm
Newsgroups: mozilla.dev.ajax
From: WenDong Zhang <zwd2...@gmail.com>
Date: Fri, 10 Jul 2009 10:20:46 +0800
Local: Thurs, Jul 9 2009 10:20 pm
Subject: Re: auto submit a form, but there is a input[name="submit"] field...
yes, I did this.

form.action += (form.action.indexOf('?') == -1 ? '?' : '&') + 'submit=' +
form.submit.value;
form.submit.name = '__'; // rename
form.submit();

this works now, but the submit value is sent by GET method, if the backend
changes (such as php will receive the request value by $_POST, $_GET,
$_REQUEST), it may not get the submit's value.

--
Best Regards!
Wen Dong

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »