• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

Javascript Validation

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
zamorin
Asked:
zamorin
  • 2
1 Solution
 
RoonaanCommented:
<select name="pAccesslevel">
 <option value="0">0</option>
 <option value="1">1</option>
</select>

;-)

-r-
0
 
zamorinAuthor Commented:
O.K, that was silly.

Let me try it, I'll get back to you soon.
0
 
zamorinAuthor Commented:
works like a dream!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now