Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    creare un alert javascript

    ciao a tutti ,come posso creare un alert java,per non permettere la registrazione(username o passwor) senza spazi??



    o meglio se uno si registra e mette la usename: antonio12 decurtis

    viene fuori un alert con scritto "non puoi sciegliere una username con spazio"

    grazie a tutti!!

  2. #2
    Esempio ...
    codice:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"  xmlns:v="urn:schemas-microsoft-com:vml">
      <head>
        <title>test</title>
        <script type="text/javascript"> 
    	function TestForBlank(str) {
    		var re=/\s./;
    		if(re.test(str)) {
    			alert("non puoi scegliere una username con spazio");
    			return false;
    		}
    		return true;
    	}
        </script>
      </head>
      <body>
    	<form onsubmit="return TestForBlank(this.CampoNome.value);" method="GET">
    		<input type="text" name="CampoNome" />
    		
    
    		<input type="submit" value="Vai" />
    	</form>
      </body>
    </html>
    HTH
    Zappa
    [PC:Presario 2515EU][Cpu:P4@2.3GHz][Ram: 512M][HDU:80G@5400 RPM]
    [Wireless:LinkSys][OS: Ubuntu 9.04 - Jaunty Jackalope]

  3. #3
    grazie mille

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.