Javascript Validation

Posted on 2004-09-22
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.");
            pass = false;
      else if (IsEmptyField(Frm.pName.value) )
            alert("Please enter Name.");
            pass = false;

etc. etc....
Question by:zamorin
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 49

Accepted Solution

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



Author Comment

ID: 12120943
O.K, that was silly.

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

Author Comment

ID: 12120965
works like a dream!

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tracking uptime for a bunch of sites 3 117
How to build a web site 17 98
Saving Web Page as PDF 9 80
ASP.NET data base connection 35 93
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to count occurrences of each item in an array.

732 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