How can we submit a form without a submit buttom?
Answers were Sorted based on User's Feedback
Answer / arvind pippal(delhi india)
you can call a function in javascript onclick event of any
form element/link and in the function you use any
document.formName.submit(); to submit the form
and above all ans is rights
Is This Answer Correct ? | 9 Yes | 2 No |
Answer / abhishek anand
Use image element instead submit button
<input type="img" src="img_path/img_name.src">
give the action page name as action attribute in form
element like
<form name="myform' action="myaction.php">
The Image element will work very similar as submit button.
Is This Answer Correct ? | 8 Yes | 3 No |
Answer / 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 |
Answer / ashwani kumar(delhi)
1 Function OnChange();
2. Function OnClick()
Is This Answer Correct ? | 1 Yes | 3 No |
How can we check the value of a given variable is a number?
What is difference between mysql_connect and mysqli_connect?
What is abstraction php?
What is the best php version for wordpress?
What is fulltextsearch
What should be the length of variable for SHA256?
what are the rules to be followed at the time of declaring a variable?,what is the purpose of var_dump()function in php,syntax of ternary operator()in php,difference between drop a table and truncate a table...
Why should I store logs in a database rather than a file?
how will i set pagination ?
What is new keyword in php?
What is session_register()?
what is the current salary package in India for a PHP programmer who has 1.5 years experience