Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding JavaScript onChange validation

 
Hozaifa Azmi
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Hozaifa Azmi
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bauke Scholtz...

will you please post the JavaScript code for the above mentioned validations.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!