473,396 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

want to validate a form (user and password) have default values and want to proceed

jsos20
11
Expand|Select|Wrap|Line Numbers
  1.  start_form("get");   #will start the form
  2.         print "What's the User name? ",textfield(-name=>'Username',-value=>'user'),
  3.      #will get the user name
  4.  
  5.     p,  #this gives a new paragraph
  6.  
  7.     "Please enter your password: ",textfield(-name=>'password',-value=>'pass'),
  8.      #will get the password
  9.  
  10.  
  11. #to validate is the problem
  12.  
  13.  
  14.     p;
  15.         if(defined $user && $user eq "") #if the defined value is equal to/or  "blank"  print
  16.         {
  17.  
  18.         print "please enter a value for name",p;
  19.         }
  20.         else
  21.         {
  22.                 if(defined $pass && $pass eq "")  #if b's value number is blank print "please enter a value for number
  23.                 {
  24.                 print "please enter a password",p;
  25.                 }
  26.         }
  27.               print hr,
  28.  
  29.     submit('Submit Details for NextScreen');   #will submit when entered
  30.     print hr;
  31.     print hr;
  32.     sub DrawLogin {
  33.     print hr,
  34.           'Username: ',
  35.           textfield( -name=>'user', -default=>'', -size=>15 ),
  36.           p,
  37.           'Password: ',
  38.           password_field( -name=>'pass', -value=>'', -size=>15 ),
  39.           p;
  40.  
  41.     print hr,
  42.           submit( -name=>'next', -value=>'Login' ),
  43.           hr;  # submits user and pass
  44.           end_form();
  45. }
  46.  
have checked if empty but want to check if user entered data to compare against it
Apr 28 '10 #1
0 1297

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Joeri KUMBRUCK | last post by:
Hello, I'm trying to create an ASP page where users can type in a username and password, and these credential should be checked with active directory. If username and password are correct, the...
2
by: Steffen Balslev | last post by:
I tried to find a way to validate user credentials using C#, searching google and lots of other news and kb sites left me without a solution. You can use a SSPI but it's that easy to implement so...
0
by: Joeri KUMBRUCK | last post by:
Hello, I'm trying to create an ASP page where users can type in a username and password, and these credential should be checked with active directory. If username and password are correct, the...
1
by: Rajani | last post by:
Hello, I am learning asp.net and i have experience in asp. I am using VS.NET for developing dotNET pages. Its login form. I placed two asp:textbox s for userid and password. and one button(html...
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
2
by: shapper | last post by:
Hello, I am trying to check if a user is valid as follows: Response.Write(Membership.ValidateUser("usr", "pass").ToString) It always gives me FALSE. The username and password are correct....
1
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. ...
2
by: RyanT | last post by:
I am trying to enhance an existing process where the user currently inputs his/her user ID and password in two separate InputBoxes. I created a form with a UserID field and a Password field (with...
3
by: ojnoka | last post by:
Hi, I am a newbie. I don't know javascript. I use the free javascripts and try to understand them. I have a javascript now, to validate username and password. I paste it below. My question now. Is...
2
by: sc0705837 | last post by:
Hi there I am trying to get my action page of the website I'm building to check to see if the form input values are empty, if they are not it will then check to see if any of the form inputs contain...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.