Jump to content
php.lv forumi

JS Promt


Mikijs

Recommended Posts

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

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 by n0r3k
Link to comment
Share on other sites

×
×
  • Create New...