Solved

Javascript Validation

Posted on 2004-09-22
3
280 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
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.

810 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