Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Javascript

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
hello ,i am using javascript in cgi-perl for popup alert and now in pop alert i am doing number checking for user input using regular expression ,
i am try to do this thing by two ways but still is not working .please help me out.
function numcheck()
{
var myForm = document.add_quiz;
var message = '';
var num=/^[0-9]+$/;

if(myForm.marks.value.match(myForm.marks.value.num)) or if(myForm.marks.value != myForm.marks.value.num)
{
alert('Please enter digit');
return(false);
}
else
{
return(true);
}
}
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
What does "it isn't working" mean? What exactly happens when the code runs? If you run it in Firefox, are there any messages in the Error Console?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post the same question to multiple forums: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread in the HTML/JavaScript forum, where it's a better fit.
 
    Bookmark Topic Watch Topic
  • New Topic