?
Solved

Javascript Validation

Posted on 2004-09-22
3
Medium Priority
?
286 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
[X]
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
3 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 500 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

Technology Partners: 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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to dynamically set the form action using jQuery.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

770 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