English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How do you write a script in Javascript or XHTML to verify a function?

2007-04-16 02:50:13 · 1 answers · asked by snoopstock 1 in Computers & Internet Programming & Design

1 answers

XHTML isn't an active thing. It just presents the contents of a web page, so no verification there. If you mean, verification of a form, then, maybe you mean something like this. Say you have a spot on a form where you've asked your page viewer to fill in a number. In that spot, you activate a javascript (set up in the xhtml via "onkeypress="javascript:checkfordigit(this);"

...which will in turn take "this" (which lets your javascript routine named "checkfordigit" check for a key, 0 through 9, and gripe to the typist if the key pressed was something other than 0 through 9...

There are other forms of verification in javascript, such as checking for blanks in the form when the "submit" button is pressed and griping to the typist if something essential was left blank...

2007-04-16 05:18:07 · answer #1 · answered by fjpoblam 7 · 0 0

fedest.com, questions and answers