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.
Javascript for submit form without using submit button
8 Answers
Know the answer? Post it. Somebody with the same question will find it here.
boycoto114 pointsPosted Apr 23, 2013, 11:06 PM EDT
http://www.w3schools.com/jsref/event_onkeypress.asp
Saritha45 pointsPosted Apr 23, 2013, 11:10 PM EDT
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...
boycoto114 pointsPosted Apr 23, 2013, 11:17 PM EDT
Saritha45 pointsPosted Apr 23, 2013, 11:23 PM EDT
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....
boycoto114 pointsPosted Apr 24, 2013, 1:00 AM EDT
<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>
Saritha45 pointsPosted Apr 24, 2013, 2:13 AM EDT
How it is working> I didn't understand...Can u please explain me?
boycoto114 pointsPosted Apr 24, 2013, 5:27 PM EDT
Saritha45 pointsPosted Apr 24, 2013, 8:52 PM EDT