selenin Posted March 1, 2011 Share Posted March 1, 2011 Hi, I'm a beginner with javascript, but I want to change my script, that the site doesn't always reload after saving a form. One form with one id I'm able to do, but different forms with the same id I don't know how. These are my forms: <form name="form1" action="linkAccount.php" method="post"> <input type="hidden" name="userid" value="73"> <input type="hidden" name="siteid" value="156144611108159"><img src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/188189_156144611108159_546075_q.jpg" /><a href="http://www.facebook.com/pages/Twitter-Follower-Adder/156144611108159" target="_blank">Twitter Follower Adder</a><br>Site active?<input type="radio" name="active" id="active" value="1" /> Yes <input type="radio" name="active" id="active" value="0" checked="checked" /> No<br>Credits <input type="text" name="credits" value="9" size="1" maxlength="1" ><br><input type="submit" name="submit" value="Save"></form><form name="form1" action="linkAccount.php" method="post"><input type="hidden" name="userid" value="73"><input type="hidden" name="siteid" value="180883525283576"><img src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/174756_180883525283576_2882015_q.jpg" /><a href="http://www.facebook.com/pages/Esoterik-Forum/180883525283576" target="_blank">Esoterik Forum</a><br>Site active?<input type="radio" name="active" id="active" value="1" checked="checked" /> Yes <input type="radio" name="active" id="active" value="0" /> No <br>Credits <input type="text" name="credits" value="4" size="1" maxlength="1" ><br><input type="submit" name="submit" value="Save"></form><form name="form1" action="linkAccount.php" method="post"><input type="hidden" name="userid" value="73"><input type="hidden" name="siteid" value="182976141739791"><img src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/174691_182976141739791_6733354_q.jpg" /><a href="http://www.facebook.com/pages/Twitter-Train-TweeterME/182976141739791" target="_blank">Twitter Train TweeterME</a><br>Site active?<input type="radio" name="active" id="active" value="1" /> Yes <input type="radio" name="active" id="active" value="0" checked="checked" /> No <br>Credits <input type="text" name="credits" value="7" size="1" maxlength="1" ><br><input type="submit" name="submit" value="Save"></form><form name="form1" action="linkAccount.php" method="post"><input type="hidden" name="userid" value="73"><input type="hidden" name="siteid" value="173933135951523"><img src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/71158_173933135951523_5026413_q.jpg" /><a href="http://www.facebook.com/pages/Kartenlegen-und-Hellsehen/173933135951523" target="_blank">Kartenlegen und Hellsehen</a><br>Site active?<input type="radio" name="active" id="active" value="1" /> Yes <input type="radio" name="active" id="active" value="0" checked="checked" /> No <br>Credits <input type="text" name="credits" value="6" size="1" maxlength="1" ><br><input type="submit" name="submit" value="Save"></form><form name="form1" action="linkAccount.php" method="post"><input type="hidden" name="userid" value="73"><input type="hidden" name="siteid" value="164928140213920"><img src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/161918_164928140213920_2220631_q.jpg" /><a href="http://www.facebook.com/pages/Astrologie/164928140213920" target="_blank">Astrologie</a><br>Site active?<input type="radio" name="active" id="active" value="1" checked="checked" /> Yes <input type="radio" name="active" id="active" value="0" /> No <br>Credits <input type="text" name="credits" value="7" size="1" maxlength="1" ><br><input type="submit" name="submit" value="Save"></form><form name="form1" action="linkAccount.php" method="post"><input type="hidden" name="userid" value="73"><input type="hidden" name="siteid" value="164411270264299"><img src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/50234_164411270264299_7938918_q.jpg" /><a href="http://www.facebook.com/pages/Spirituelle-Lebensberatung/164411270264299" target="_blank">Spirituelle Lebensberatung</a><br>Site active?<input type="radio" name="active" id="active" value="1" checked="checked" /> Yes <input type="radio" name="active" id="active" value="0" /> No <br>Credits <input type="text" name="credits" value="8" size="1" maxlength="1" ><br> <input type="submit" name="submit" value="Save"></form> Now my question, is there a way to submit each form without reloading the site? Quote Link to comment https://forums.phpfreaks.com/topic/229326-multiple-forms/ Share on other sites More sharing options...
xenophobia Posted March 2, 2011 Share Posted March 2, 2011 Yes, use AJAX. Quote Link to comment https://forums.phpfreaks.com/topic/229326-multiple-forms/#findComment-1181635 Share on other sites More sharing options...
selenin Posted March 2, 2011 Author Share Posted March 2, 2011 Thanks xenophobia, just made it works very well Quote Link to comment https://forums.phpfreaks.com/topic/229326-multiple-forms/#findComment-1181638 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.