validation code / function to allow only NUmbers in a text box
Answer Posted / shwetha kamath
function validate_user_editadvanced_form_username(element)
{var valid = "0123456789"
var ok = "yes";
var temp;
for (var i=0; i<element.value.length; i++) {
temp = "" + element.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("Invalid entry! Only numbers are accepted!");
element.focus();
element.select();
}
}
| Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
code to positioning of window in certain dimensions
how to Auto Scroll the page
code to detect availability of cookies
create Drop-Down Navigation Menus
program to bring a window to the front
code to detect versions of different browsers like internet explorer, netscape, mozilla, opera etc
program to show a progress bar
how to create Expandable and Collapsible Menus
Create a ViewState Property?
how to pass data between pages using Frames
write a code to generate pseudorandom numbes
how to create a Custom Scrollbar
communication between main window and new windows
code to sorting an array of objects
code to create a new window