How to make a anchor tag refreshes like a submit button
Started on the old forum in November 2012 · view the original in the archive · old links redirect here
Pablo wrote: anyone knows how to do this in php?
This problem can be achieved by java script see the script snippet below. When link is clicked, it will call java script function, within java script function
document.forms["gtriddim"].submit();
will be used to auto submit the form values.......
Javascript code
<script type="text/javascript">
function submitform()
{
document.forms["gtriddim"].submit();
alert("Value has been sumitted");
}
</script>
Your Form Code using the Anchor Tag as submit button
<form id="gtriddim" action="submit.php" method="post">
<input type="text" name="query">
<a href="javascript: submitform()">Submit</a>
</form>
Now the below code is your "submit.php" form which will collect the values from the above code
<?php
$details = $_POST['query'];
echo "Submitted values is $details";
?>
That's it......... 🙂
FREE International SMS
GYSMS.com Provides FREE International sms Reach over 775 networks in more than 221 countries at no cost to you. and the Good News is we own our SMS Hardware so there is no third party SMS API involved our services are completely Ad supported.....
Send FREE International MMS and Share Files worldwide using our MMS Service.
GTriddim Live Online Radio Station