Connecting Tech Pros Worldwide Help | Site Map

submitting a form without action parameter

Tauqir
Guest
 
Posts: n/a
#1: Aug 4 '05
Hi,
Is there a trick for submitting an HTML form without action parameter
pointing to the target file?

I am trying to reverse engineer an html form inside a jsp page. and
this is what I come across

<form method="POST" name="Userpasshidden" onsubmit='return true'><!--
action="../../login.jsp" -->
.....
<input id="bok" class="buttonAction" type="button" value="OK"
onclick="doLogin()">

--------

this is the doLogin function

function doLogin() {
document.forms.Userpasshidden.user.value =
doEncode(document.forms.Userpass.duser.value);
document.forms.Userpasshidden.pass.value =
doEncode(document.forms.Userpass.dpass.value);
if (document.all) document.all["bok"].disabled = true;
else document.getElementById("bok").disabled = true;
document.forms.Userpasshidden.submit();
}

Danny
Guest
 
Posts: n/a
#2: Aug 4 '05

re: submitting a form without action parameter



You have to be more specific on what you need. Forms, submit to action=
file, that's what submit is for, if you don't have an action, then,
there's nothing to submit, so, the absence of action= defeats by itself
any submission of any kind, I gather you mean, use form elements for other
processing, not making a server call with parameters.


Danny
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Randy Webb
Guest
 
Posts: n/a
#3: Aug 4 '05

re: submitting a form without action parameter


Danny said the following on 8/2/2005 1:09 AM:[color=blue]
>
> You have to be more specific on what you need. Forms, submit to
> action= file, that's what submit is for, if you don't have an action,
> then, there's nothing to submit, so, the absence of action= defeats by
> itself any submission of any kind, I gather you mean, use form elements
> for other processing, not making a server call with parameters.[/color]

Ok, so, if I have no action then the form won't submit? In WHAT browser?
If no action is present, the form submits to itself. Had you tested that
before you posted, you would know that. But testing is beyond your
abilities evidently.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
David Dorward
Guest
 
Posts: n/a
#4: Aug 4 '05

re: submitting a form without action parameter


Tauqir wrote:
[color=blue]
> Is there a trick for submitting an HTML form without action parameter
> pointing to the target file?[/color]

Depend on browser error correction? Most submit to the current URL, some
submit to action="./".

Leaving the action attribute off is very bad form (and it is *required* by
the spec).


--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Tauqir
Guest
 
Posts: n/a
#5: Aug 5 '05

re: submitting a form without action parameter


Guys, Thanks very much for your help. It was the case that the action=
nothing was posting to itself.

Closed Thread


Similar JavaScript / Ajax / DHTML bytes