aspose file tools
The moose likes JSF and the fly likes Regarding JavaScript onChange validation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Regarding JavaScript onChange validation" Watch "Regarding JavaScript onChange validation" New topic
Author

Regarding JavaScript onChange validation

Hozaifa Azmi
Greenhorn

Joined: Jan 03, 2009
Posts: 22
Dear All...


Kindly, let me know how can I implement JavaScript in a JSF page ?

I have three input text fields, userid, Name, & E-mail id;
I need to implement JavaScript onChange validation, i.e
if the user inputs Characters in the userid input field & moves to next
input field, he should get the error message "User Id can't be characters".
without clicking the submit botton.

Similar validations for other input fields, name & e-mailid.

kindly, put the code.


Thank you in advance,
H.N. Azmi
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Javascript runs at the client side and intercepts on HTML only.
JSF runs at the server side and produces HTML output.

So when writing Javascript for JSF, you should ignore the JSF code and only concentrate on its HTML output. Open up a JSF page in your favourite webbrowser, view its page source and base your Javascript on it.


Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
Hozaifa Azmi
Greenhorn

Joined: Jan 03, 2009
Posts: 22
Hi Bauke Scholtz...

will you please post the JavaScript code for the above mentioned validations.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
No, I will not. Hire a Javascript developer, or follow a Javascript course/book yourself, or try a Javascript forum where in you post the question the smart way.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Regarding JavaScript onChange validation
 
Similar Threads
problem with onchange event
help with JavaScript function
B&S: Owner ID
javascript validation
onblur, onchange, button clicked