Mikijs Posted April 23, 2008 Report Share Posted April 23, 2008 Kā la lai ar Javascript nosaka cik daudz tekstu drikst ierakstit ieks PRomt ? echo "function editfolder(){ var NewName=prompt('Please Enter New Name'); // Pienemsim ka man vajag 20 simboli (Max) ka to lai izdara? if(NewName) window.location='renamefolder_action.php?mbox_id=$mbox_id&newfoldername=' + NewName + '&user_id=$user_id'; }"; Link to comment Share on other sites More sharing options...
Aleksejs Posted April 23, 2008 Report Share Posted April 23, 2008 Nekā! Vari vienkārši pārbaudīt pēc tam, vai nav ievadīts vairāk nekā atļauts. Link to comment Share on other sites More sharing options...
n0r3k Posted April 23, 2008 Report Share Posted April 23, 2008 (edited) Ar JS neņemos, bet nu darītu šitā. Kamēr nav ievadīts vai pārsniedz 20 simbolus, tikmēr prompto. while (!reply || reply.length > 20) var reply = prompt("vards", "Ne vairak ka 20 simboli"); alert(reply); Tev tas izskatītos tā : echo "function editfolder(){ while (!NewName || NewName.length > 20) var NewName = prompt('Please Enter New Name', 'Not more than 20 characters'); window.location='renamefolder_action.php?mbox_id=$mbox_id&newfoldername=' + NewName + '&user_id=$user_id'; }"; Edited April 23, 2008 by n0r3k Link to comment Share on other sites More sharing options...
Recommended Posts