submitting a form through javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maheswaran
    New Member
    • Mar 2007
    • 190

    submitting a form through javascript

    Hi all,

    I have submit a form through javascript (after some time delay using body onload) and input type is image, not button. If input type is button then form has submited, but in the case of image form not submitted. wht is problem.all frames are in same domain.

    My code is

    [HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator " CONTENT="EditPl us">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Descripti on" CONTENT="">
    <script>
    function update(){

    document.forms[0].submit.click() ;
    }
    function chk()
    {
    setTimeout("upd ate()","2000");
    }
    function ask()
    {
    alert("yes");
    }
    </script>
    </HEAD>

    <BODY onload="chk()">
    <form name="frm" id="frm1" action="aa.php" method="post">
    <input type="image" name="submit" src="arrow.png" value="submit" onclick="return ask();">
    </form>
    </BODY>
    </HTML>[/HTML]

    thanks in advance
    Last edited by gits; Dec 22 '07, 12:33 PM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    hi ...

    of course ;) ... only a submit button submits the form without doing anything additionlly ... but you may send the form through javascript:

    [HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator " CONTENT="EditPl us">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Descripti on" CONTENT="">
    <script>
    function submit_form(for m_id) {
    var form = document.getEle mentById(form_i d);
    form.submit();
    }
    </script>
    </HEAD>

    <BODY onload="chk()">
    <form name="frm" id="frm1" action="aa.php" method="post">
    <input type="image" name="submit" src="arrow.png" value="submit" onclick="submit _form('frm1');" >
    </form>
    </BODY>
    </HTML>[/HTML]
    kind regards

    Comment

    • maheswaran
      New Member
      • Mar 2007
      • 190

      #3
      thank god,

      thanak u very much for this gits. it is not gits its my gifts

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        no problem :) ... post back to the forum anytime you have more questions ...

        kind regards

        Comment

        • maheswaran
          New Member
          • Mar 2007
          • 190

          #5
          hi,
          can you tell me a best crm for customer service tracking (specially for litication)

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            could you explain in more detail what you need? ... a hint for a out of the box solution? what should it do?

            kind regards

            Comment

            • maheswaran
              New Member
              • Mar 2007
              • 190

              #7
              Hi gits,

              I need one good open source crm, it will track product process status, ticketing, like this specially in litigation field....

              Why i could not email notication on my post...?

              Comment

              • gits
                Recognized Expert Moderator Expert
                • May 2007
                • 5390

                #8
                hmmm ... may be you could ask that question in the Misc. Questions forum ... perhaps sombody knows a software you are looking for ...

                kind regards

                Comment

                • gits
                  Recognized Expert Moderator Expert
                  • May 2007
                  • 5390

                  #9
                  Originally posted by maheswaran
                  Why i could not email notication on my post...?
                  i think this is a known bug that will be fixed in the future ... have a look at this thread ...

                  kind regards

                  Comment

                  Working...