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

how to check h:message id exist or not in JSF

 
Swetha Potluri
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i have a <h:message> for a text box.

eg:- <h:message id = "updateMsg'" for="update" styleClass="success"></h:message>

Step1: In success scenario i am displaying success message for that text box

Step2: After the success Step1, Now i am giving a wrong value in the text box.It is getting validated by a javascript. Before validating i am resetting the message by

document.getElementById(FormName:updateMsg').innerHTML = '';

Problem:
If i am going to step 2 directly then i am getting JS error that document.getElementById(....) is null or not an object at this line document.getElementById(FormName:updateMsg').innerHTML = '';

So how to check h:message id exist or not in JSF

please provide some solutions

Thanks
 
please buy this thing and then I get a fat cut of the action:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!