HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 17th, 2005, 10:54 PM
kelvinlim11 kelvinlim11 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 123 kelvinlim11 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 2 m 8 sec
Reputation Power: 0
can any1 look at it?

function IsNumeric(sText)
{
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;

alert("GHJHGH");
alert(sText);
for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
{
alert("NUMBER!");
IsNumber = false;
}
}
return IsNumber;

}
//-->

<!--
function confirmation() {
var answer = confirm("Are you sure you want to SAVE the form?")
if (answer){
return true;
}
else{
return false;
}
}
//-->


<!-- Begin
function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (tempobj.name.substring(0,8)=="required") {
if (((tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charA t(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
}
}
}
}
if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUppe rCase();
alert("Please make sure the "+shortFieldName+" field was properly completed.");
return false;
}
else
{
var isnum =true;
if(tempobj.name.substring(0,13) == "requiredJOBNO"){
isnum = IsNumeric(which);}

var answer = confirmation();
if(answer && isnum){
return true;
}
return false;
}

}
// End -->
</script>


i use the onSubmit to call the checkrequired function
tehn i will use the function to check if the fields have been entered by the user

then i will go on to check if the jobno field is numeric... but then i have a prob... it dun seems to go into the isnumeric function
and i am not sure how to work with the WHICH( as in how to get values out or the name...)

can any1 pls help???
thks

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > can any1 look at it?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT