Form.submit
hi, i have a form that looks somthing like this...
<form name=userInfo action="cgi-bin/userinfo.pl" method=post>
blah
blah
blah
<!-- now i have an optional link allowing the user to go to a different page to upload a picture-->
<a href="upload.htm" onclick=upload()>Upload a picture</a>
<!-- and the standard submit button -->
<input type=submit value=Go>
</form>
now, if the user decides to use the link to go to the upload page, i still want the form to be processed so they dont lose any info theyve already entered. here is what i tried...
<SCRIPT LANGUAGE=javascript>
function upload()
{ Forms.userInfo.submit; }
or
function upload()
{ Form.submit; }
or
function upload()
{ userInfo.submit; }
</JAVASCRIPT>
the link works and there are no javascript errors, however, the form is never processed by userinfo.pl
do i have the right idea?
any help would be appreciated.
thanks
ROB posted this at 02:05 — 27th February 2000.
They have: 447 posts
Joined: Oct 1999
ok, i figured out the correct way to refer to the form would be
document.form.userInfo
but
document.form.userInfo.submit still does not submit the info
Vincent Puglia posted this at 01:06 — 29th February 2000.
They have: 634 posts
Joined: Dec 1999
Hi,
document.formname.submit();
Real question, though, is where are you executing the submission? From the image page? (you would then need windowname.document.formname.submit() )
Also, are you still using the submit button or a regular button with onclick?
see "Validating Forms 1" at my site
Vinny
------------------
GrassBlade: cut&paste javascript
Where the world once stood
the blades of grass cut me still
ROB posted this at 02:25 — 29th February 2000.
They have: 447 posts
Joined: Oct 1999
well, i decided not to do it the hard way and just bring the user to a seperate upload form after the userinfo is submitted.
thx for the reply
btw nice site
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.