anonīms Posted January 13, 2010 Report Share Posted January 13, 2010 (edited) I-netā pēc šiem vārdiem neko neatradu. Tātad lietoju šādu kodu: <select name='iespejas' onchange='location = this.options[this.selectedIndex].value;'> ... <option value="/forums/topic/'.$temats['temata_id'].'/delete/">Dzēst tematu</option> Vai ir iespējams, ka kādam noteiktam value (vai arī visiem) pirms nostrādā location tiek izmests apstiprināšanas logs ar to, vai tiešām tas ir nepieciešams (Ok/Cancel)? Paldies. Edited January 13, 2010 by anonīms Quote Link to comment Share on other sites More sharing options...
briedis Posted January 13, 2010 Report Share Posted January 13, 2010 (edited) <select name='iespejas' onchange='if(confirm("Točna dzēst?")){location = this.options[this.selectedIndex].value;}'> Edit: ja gribi atsevišķai grupai prasīt, tad šitā var mēģināt: <select onchange="doStuff(this);"> <option value="/dzest/kkas/">Dzēst</option> <option value="/cits/kkas/asd/">Darīt</option> <option value="/ok/es">Neko</option> </select> <script type="text/javascript"> function doStuff(e){ var index = e.selectedIndex; var link = e.options[index].value; //Ja indekss ir viens vai otrs, pārbaudam if(index == 0 || index == 1){ if(!confirm('Tiešām to darīsi?')){ return false; } } location.href = link; } </script> Edited January 13, 2010 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.