Solved

Javascript Validation

Posted on 2004-09-22
3
278 Views
Last Modified: 2009-12-16
I need to insert another form field named "pAccessLevel" and the user can only enter the values '1' or '0'. What is the javascript for that?

My current code is as follows:


function validForm()
{
      var Frm, pass;              
         Frm = document.AdminListUser;
      pass = true;

      if (IsEmptyField(Frm.pUserName.value) )
      {
            alert("Please enter User ID.");
            Frm.pUserName.focus();
            pass = false;
      }
      else if (IsEmptyField(Frm.pName.value) )
      {
            alert("Please enter Name.");
            Frm.pName.focus();
            pass = false;
      }

etc. etc....
0
Comment
Question by:zamorin
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 125 total points
ID: 12120933
<select name="pAccesslevel">
 <option value="0">0</option>
 <option value="1">1</option>
</select>

;-)

-r-
0
 
LVL 5

Author Comment

by:zamorin
ID: 12120943
O.K, that was silly.

Let me try it, I'll get back to you soon.
0
 
LVL 5

Author Comment

by:zamorin
ID: 12120965
works like a dream!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Read about why website design really matters in today's demanding market.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now