In this post, we learn how to make submit form using jquery with PHP codes. Following this post, we learn to make jquery form & jquery form submit system with jquery ajax PHP example codes.
You know PHP is a very ordinary and popular programming language for creating any dynamic in the web application. Depend on my past through in this post you get just an awesome application for codes demo.
Read Also:
1. 10 Windows Run Commands For Quickly Access Your Computer
2. How To Make Flash Effect Image Loading With Jquery
3. How To Make Chatting Application with Jquery and Ajax
4. Games With HTML Codes: Make A Snake Game With Notepad
Submit Jquery Duplicate Fields Form with PHP
<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js“></script>
<script type=”text/javascript” src=”reCopy.js“></script>
<script type=”text/javascript”>
$(function(){
var removeLink = ‘ <a class=”remove” href=”#” onclick=”$(this).parent().slideUp(function(){ $(this).remove() }); return false”>remove</a>‘;
$(‘a.add’).relCopy({ append: removeLink});
});
</script>
//HTML code
<form method=”post” action=”clonesubmit.php”>
<p class=”clone”> <input type=”text” name=”hobby[]” class=’input’/></p>
<p><a href=”#” class=”add” rel=”.clone”>Add More</a></p>
<input type=”submit” value=” Submit ” />
</form>
<?phpif($_POST[‘hobby’])
{
$array=$_POST[‘hobby’];
foreach($array as $hobby)
{
if(strlen($hobby)>0)
{
$sql=mysql_query(“insert into hobbies(hobby)values(‘$hobby’)”);
}
}
}
?>