How can we submit a form without a submit buttom?
Answer Posted / ram gopal verma
<script type="text/javascript">
function validateAndSubmit()
{
if(document.getElementById('user_id').value=='') {
alert('Please enter user id');
document.getElementById('user_id').focus();
}
else
if(document.getElementById('pass').value=='')
{
alert('Please enter password');
document.getElementById('pass').focus();
}else
{
document.form1.submit();
}
}
</script>
<form id="form1" name="form1" method="post" action="action.php" onsubmit="return validate()">
<input type="text" name="user_id" id="user_id" />
<input type="password" name="pass" id="pass" />
<a href="javascript:validateAndSubmit();">Submit Me..</a>
</form>
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How can we submit from without a submit button?
Who created numbers?
What is sticky form in php?
How to block direct directory access in PHP?
How can I make a script that can be bilingual (supports english, german)?
What is binary safe function in php?
Does php have multiple inheritance?
What is form validation in php?
What does addslashes do in php?
Is php front end?
How to delete cookie files on your computer?
What would occur if a fatal error was thrown in your php program?
What is putenv?
How to close a session properly?
Explain Traits in PHP?