SunQuest
           WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old October 3rd, 2004, 05:34 PM
nimble47 nimble47 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 nimble47 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool How to validate mandatory fields and password in one go through single WMLS code file

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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > How to validate mandatory fields and password in one go through single WMLS code file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway