Genesis Posted November 8, 2009 Report Share Posted November 8, 2009 Tipa doama ir tāda ka ir poga. Nedrikst laut lietotajam nospiest pogu 2x, tapec iepinu js. Doma bija tada, ka lietotajs nospiez 1x pogu, tā disablojas un izpildas nopstotā forma... nu jā.. it kā uzrakstiju, bet nestrada. :) varbut kads zin kas pie vainas?.. :) JS: <script type="text/javascript"> function dis_button(a) { document.getElementById('butt'+a).disabled=true; document.getElementById('form'+a).submit(); } </script> PHP: ..........kods....... echo '<form id="form'.$counter++.'"action="edit_gallery.php?id='.$galleryID.'" method="post">'; echo'<input id="butt'.$counter.'" type="submit" name="up" value="UP" onclick="dis_button('.$counter.')"/> <input type="submit" name="down" value="DOWN"/> <input type="submit" name="delete" value="Dzēst"/> </form>'; Quote Link to comment Share on other sites More sharing options...
briedis Posted November 8, 2009 Report Share Posted November 8, 2009 <input type="button" value="Klikšķini!" onclick="this.disabled=true;this.value='Pietiks...'"/> ? Quote Link to comment Share on other sites More sharing options...
Genesis Posted November 8, 2009 Author Report Share Posted November 8, 2009 (edited) a pec pogas diabloshanas izpildisies pogas posts? nu tipa : <?php if (isset($_POST['kkas'])) { echo "āsd"; }; ?> <form id="asd" action="me.php" method="post"> <input type="submit" name="kkas" value="Nespaidi mani" onclick="this.disabled=true;this.value='Pietiks...'"/> </form> vai .. notiks echo? nenotiks tacu.. vismaz man ta liekas.. :) Edited November 8, 2009 by Genesis Quote Link to comment Share on other sites More sharing options...
briedis Posted November 8, 2009 Report Share Posted November 8, 2009 A varbūt notestē? :) Vispār submit poga nedarīs neko, ja onclick atgriezīs false... Quote Link to comment Share on other sites More sharing options...
Genesis Posted November 8, 2009 Author Report Share Posted November 8, 2009 Notesteju.. nestrada tavs varaints.. :) Quote Link to comment Share on other sites More sharing options...
briedis Posted November 8, 2009 Report Share Posted November 8, 2009 (edited) Nezinu kas tev tur nestrādā, bet man viss strādā. <form method="post" action="http://google.lv"> <p> <input type="submit" value="Klikšķini!" onclick="this.disabled=true;"/> </p> </form> Edit: Strādā, bet kaut kādā jēgā pazūd pats submit lauks. Ja ir kāds cits lauks, tad tas no-post-ojas. Edit2: Pieleca - ja lauks skaitās disabled, tad loģiski, ka pārlūks saprot, ka no viņa nav nekādas jēgas un viņš netiek padots post datos. Edit3: Šitam gan būtu jāstrādā: <script type="text/javascript"> var submitted = false; function submitMe(){ if(!submitted){ submitted = true; return true; }else{ alert('Esi jau spiedis!'); } return false; } </script> <form method="post" action="http://asdsfdsf.com"> <p> <input type="submit" name="ok" value="Klikšķini!" onclick="return submitMe();"/> </p> </form> Edit4: Bet vispār tev nevajadzētu pļauties uz JS, jo refresh jau tāpat varēs nospiest... Edited November 8, 2009 by briedis Quote Link to comment 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.