Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding JavaScript onChange validation  RSS feed

 
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!