Skip to content

Javascript for submit form without using submit button

Saritha

Asked Apr 23, 2013, 10:59 PM EDT8 answers
Share
LinkedInX
Hi,

 I just want to submit a form without using submit button.For example observe this site http://schools9.com/apinter1g.htm.By entering hall ticket number in textbox,immediately display the output without pressing any key.

8 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hi,

    i tried with that,but the problem is the entire page is refreshed.I don't want to refresh the page.If u know please provide me complete code...
    0
  • 0
       

      Whatever u gave,that one also i tried...but,here after entering value in textbox,u have to press any key...then only it is working...my requirement is without pressing any key i want to dispaly the result...I already gave one site  http://schools9.com/apinter1g.htm..just u open this site and enter 10 digit hall ticket number 1322122819...then u observe..how the output will be display....
    0
  • 0
    try this...

    <html>
        <head>
            <script type="text/javascript" src="Scripts/jquery-1.9.1.js"></script>
            <script type="text/javascript">
                $(document).ready(function() {
                            $("#txtActorID").on("keyup", function() {
                            if ($("#txtActorID").val().length == 5)
                                    alert($("#txtActorID").val());
                            });
                    });
            </script>
        </head>
        <body>
            <form>
                <label>Actor ID:</label><input type="text" id="txtActorID" />
            </form>
        </body>
    </html>
    0
  • 0
       

    How it is working> I didn't understand...Can u please explain me?
    0
  • 0
    I did not try to work with the page that you gave yesterday, but what I gave is a solution (might be) that fits on the subject given. Since you will be submitting form without clicking on the submit button, then, all you have to do is determine the length of characters inputted by the user, if in case, that the length of the input is equal to five, then, you have to execute a command (function).
    0
  • 0
    I tried with that one what u gave....but,here after entering input in textbox by press enter...the input what u gave in textbox is cleared..Can u please provide me complete code...
    0