submitting a form without action parameter


T

Tauqir

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();
}
 
Ad

Advertisements

R

Randy Webb

Danny said the following on 8/2/2005 1:09 AM:
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.

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.
 
D

David Dorward

Tauqir said:
Is there a trick for submitting an HTML form without action parameter
pointing to the target file?

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).
 
Ad

Advertisements

T

Tauqir

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

Top