/ Forside / Teknologi / Udvikling / Java Scripts / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Java Scripts
#NavnPoint
molokyle 5410
Klaudi 2799
smorch 2439
kim 1360
Harlekin 1134
bentjuul 984
gibson 800
severino 695
Random 675
10  konsulent.. 626
Trouble using the comma character in a for~
Fra : Nils Lastein


Dato : 14-06-01 18:04

I've got a simple HTML-form. Unfornunately the field names is writting using
a comma like this:
<input type="submit" name="abc,ABC" value=" NEXT ">

This is valid using serverside CGI-applications. But "clicking" the
submit-button using javascript is difficult because:
formName.abc,ABC.click(); isn't valid.

year year... You'll say: "Rename the submit button"... But I'm not able to
do that, because it's generated serverside by a media asset management
software (Cumulus).

Reply plz using email

Nils



 
 
Matt Kruse (14-06-2001)
Kommentar
Fra : Matt Kruse


Dato : 14-06-01 19:04

Nils Lastein <nila@dsr.kvl.dk> wrote:
> I've got a simple HTML-form. Unfornunately the field names is writting
using
> a comma like this:
> <input type="submit" name="abc,ABC" value=" NEXT ">

This is not a valid input name according to the HTML specifications. So, you
can't expect it to work.

Why would you want to .clik() this object, anyway?
It's a submit button. Just call the form.submit() yourself.

Matt Kruse
http://www.mattkruse.com/






Nils Lastein (14-06-2001)
Kommentar
Fra : Nils Lastein


Dato : 14-06-01 19:19

"Matt Kruse" <mkruse@netexpress.net> wrote in message
news:3b28fba7$0$23242@wodc7nh0.news.uu.net...
> Nils Lastein <nila@dsr.kvl.dk> wrote:
> > I've got a simple HTML-form. Unfornunately the field names is writting
> using
> > a comma like this:
> > <input type="submit" name="abc,ABC" value=" NEXT ">
>
> This is not a valid input name according to the HTML specifications. So,
you
> can't expect it to work.
>
> Why would you want to .clik() this object, anyway?
> It's a submit button. Just call the form.submit() yourself.

There are several submit forms... nice huh?

ie:
<FORM METHOD="GET" ACTION="cuwp_cgi">
<INPUT name="B_X_TN,QPN1" type=submit value=" Previous ">
<INPUT name="B_X_TN,QPN3" type=submit value=" Next ">
.....

I want to "fake" a click on the "Next" button?

Nils



Grant Wagner (14-06-2001)
Kommentar
Fra : Grant Wagner


Dato : 14-06-01 20:41

Nils Lastein wrote:

> "Matt Kruse" <mkruse@netexpress.net> wrote in message
> news:3b28fba7$0$23242@wodc7nh0.news.uu.net...
> > Nils Lastein <nila@dsr.kvl.dk> wrote:
> > > I've got a simple HTML-form. Unfornunately the field names is writting
> > using
> > > a comma like this:
> > > <input type="submit" name="abc,ABC" value=" NEXT ">
> >
> > This is not a valid input name according to the HTML specifications. So,
> you
> > can't expect it to work.
> >
> > Why would you want to .clik() this object, anyway?
> > It's a submit button. Just call the form.submit() yourself.
>
> There are several submit forms... nice huh?
>
> ie:
> <FORM METHOD="GET" ACTION="cuwp_cgi">
> <INPUT name="B_X_TN,QPN1" type=submit value=" Previous ">
> <INPUT name="B_X_TN,QPN3" type=submit value=" Next ">
> ....
>
> I want to "fake" a click on the "Next" button?
>
> Nils

<input type="button" value="Fake click on Next"
onclick="document.forms[0].elements['B_X_TN,QPN3'].click();">

Works in the following browsers: IE 5.01SP2, Netscape 4.61 and Mozilla 0.9.1+
Mozilla/5.0 (Windows; U; Win95; en-US; rv:0.9.1+) Gecko/20010613

Of course, you just move the onclick event code
(document.forms[0].elements['B_X_TN,QPN3'].click();) to wherever you want to
fake the clicking of "Next".

--
| Grant Wagner <gwagner@ugg.com>

* Client-side Javascript and Netscape DOM Reference available at:
* http://developer.netscape.com/docs/manuals/javascript.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtmlrefs.asp
* Tips for upgrading JavaScript for Netscape 6/Mozilla
* http://www.mozilla.org/docs/web-developer/upgrade_2.html



Søg
Reklame
Statistik
Spørgsmål : 177501
Tips : 31968
Nyheder : 719565
Indlæg : 6408528
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste