submitting a form without action parameter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tauqir

    submitting a form without action parameter

    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="Userpassh idden" onsubmit='retur n true'><!--
    action="../../login.jsp" -->
    .....
    <input id="bok" class="buttonAc tion" type="button" value="OK"
    onclick="doLogi n()">

    --------

    this is the doLogin function

    function doLogin() {
    document.forms. Userpasshidden. user.value =
    doEncode(docume nt.forms.Userpa ss.duser.value) ;
    document.forms. Userpasshidden. pass.value =
    doEncode(docume nt.forms.Userpa ss.dpass.value) ;
    if (document.all) document.all["bok"].disabled = true;
    else document.getEle mentById("bok") .disabled = true;
    document.forms. Userpasshidden. submit();
    }

  • Danny

    #2
    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/

    Comment

    • Randy Webb

      #3
      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.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

      Comment

      • David Dorward

        #4
        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

        Comment

        • Tauqir

          #5
          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.

          Comment

          Working...