|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Hi I wonder if any body could help me . Iam making a small/basic "login" program in WML/WML Script for Mobile browser. My program takes a user name and password from the user and than validate it, that both the fields should be entered by the user.If any of the filed is not enetered by the user it gives error message. Now i want to validate the password aganist some static text through the same valdiate.wmls code(have a look my following code).How can i Do this.One thing that i have already tried but didn't work (that was)
------This didn't work--------------- var pass=WMLBrowser.getVar("pass"); var temp="quest"; var comp=String.compare(pass,temp); if(comp==1) { WMLBrowser.go("Signin.wml#Error"); } else if(comp==0){ WMLBrowser.go("Signin.wml#Hello"); } } Could any body give the tell me(code) that how in one go manadatory field and password validation can be done through on single wmls file.I just want it in this if [1]if user left any/ both mandatory fileds empty then it should give error message [2]if Login field is left empty but the password is right it should give error message too. [3]if both fields are enetered and passowrd is right then it should move on to the next screen ------------------Signin.wml--------------------------------------- <card id="Login" title="Login" newcontext= "true"> <do type="accept"> <go href="validate.wmls#validate()"/> </do> <p> <big><b>Login:</b></big><br/> <input type="text" name="login" format="*M"/> <big><b>Password:</b></big><br/> <input name="pass" type="password"/><br/> </p> </card> -------------Validate.wmls---------------------------------- extern function validate() { var login=WMLBrowser.getVar("Login"); var pass=WMLBrowser.getVar("pass"); var temp="quest"; if (String.isEmpty(login)) WMLBrowser.go("Signin.wml#badlogin"); else if (String.isEmpty(pass)){ WMLBrowser.go("Signin.wml#badlogin"); } else{WMLBrowser.go("Signin.wml#Ok"); } } Thank you RAFI |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > How to validate mandatory fields and password in one go through single WMLS code file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|