Solved

Javascript Validation

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Read about why website design really matters in today's demanding market.
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
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…

830 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