Message from discussion
auto submit a form, but there is a input[name="submit"] field...
Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!backlog2.nntp.dca.giganews.com!nntp.mozilla.org!news.mozilla.org.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 09 Jul 2009 21:20:50 -0500
Return-Path: <zwd2...@gmail.com>
X-Original-To: dev-a...@lists.mozilla.org
Delivered-To: dev-a...@lists.mozilla.org
X-Virus-Scanned: amavisd-new at mozilla.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
h=domainkey-signature:mime-version:received:in-reply-to:references
:date:message-id:subject:from:to:cc:content-type;
bh=31zgLEPzAvCjk59bOfoSslHBtmRATcZ97M1Cp3cvq80=;
b=T0h2fkVpbchpb5NV4jXMXKW4ONKXiE18JPDNrZ8o45hSZvv6EnJ0ayQm6UGs/pdkEn
I+xNC9t4gAqru9A/Nkn01kzmMNoByYqWf+4eqWJlnFi03poyRhO4KC4AiwXYJwJ90dcj
rwaztE2UzvLHeD3yfWRTsYO6ZC0f6rx6IlRYg=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:cc:content-type;
b=Mqb+bq5JKWXvRM/ewYmI47wYGrjIwxoYCOzm5TBS1hoiwE+ZQMa3ZWHs/mXkEpHCsY
wmIE9jPLBnZjUlngPxyloAfrG2sH9i6cn0sQCd5szLyA5ey6a5Bah0lTLm7OuLyl/Skn
KpGzN8vmnV6phtbYXngu5lbOwXI2e/GxZ57iU=
MIME-Version: 1.0
In-Reply-To: <INOdneXxbs8ncsjXnZ2dnUVZ_tSdnZ2d@mozilla.org>
References: <mailman.3322.1247142954.5555.dev-ajax@lists.mozilla.org>
<INOdneXxbs8ncsjXnZ2dnUVZ_tSdnZ2d@mozilla.org>
Date: Fri, 10 Jul 2009 10:20:46 +0800
Subject: Re: auto submit a form, but there is a input[name="submit"] field...
From: WenDong Zhang <zwd2...@gmail.com>
To: Martin.Hon...@gmx.de
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Content-Filtered-By: Mailman/MimeDel 2.1.12
Cc: dev-a...@lists.mozilla.org
X-BeenThere: dev-a...@lists.mozilla.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "For discussing AJAX as a design philosophy or development
methodology, including AJAX frameworks, toolkits, advancements,
optimization, debugging,
and development techniques." <dev-ajax.lists.mozilla.org>
List-Unsubscribe: <https://lists.mozilla.org/options/dev-ajax>,
<mailto:dev-ajax-requ...@lists.mozilla.org?subject=unsubscribe>
List-Post: <mailto:dev-a...@lists.mozilla.org>
List-Help: <mailto:dev-ajax-requ...@lists.mozilla.org?subject=help>
List-Subscribe: <https://lists.mozilla.org/listinfo/dev-ajax>,
<mailto:dev-ajax-requ...@lists.mozilla.org?subject=subscribe>
Newsgroups: mozilla.dev.ajax
Message-ID: <mailman.3402.1247192449.5555.dev-a...@lists.mozilla.org>
Lines: 59
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 63.245.208.166
X-AuthenticatedUsername: NoAuthUser
X-Trace: sv3-G0BswM1NzfpxLhaDr3Lt2HXmKP8m7aEAFp9WOBt55Q4/1a8vbt1ssfpQtzniEjtUo9yeICg6jEFw00v!VvfGK2V6eqKy9PBwdnlrdZxqTQ6Y+HNSxrfRc5IMxUs3EJKgZqc0ZXHytzS5kckIyPO+S0v0V4C5!Vswcmsp/DlIORg2QcJgBVBFm5yZ+
X-Complaints-To: ab...@mozilla.org
X-DMCA-Complaints-To: ab...@mozilla.org
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.39
X-Original-Bytes: 4588
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.
On Thu, Jul 9, 2009 at 9:25 PM, Martin Honnen <mahotr...@yahoo.de> wrote:
> WenDong Zhang wrote:
>
>> 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
>>
>
> You will need to rename that input first.
>
> --
>
> Martin Honnen
> http://msmvps.com/blogs/martin_honnen/
> _______________________________________________
> dev-ajax mailing list
> dev-a...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-ajax
>
--
Best Regards!
Wen Dong