You need to sign in to do that
Don't have an account?

Client Side Javascript Validation in Visualforce
I am getting javascript error (null object) message while referencing inputbox.
Problem: Visualforce is adding "j_id0:FormName:txtFirstName" in the Id
- duplicate ids cause very bad, inconsistent, behavior in different browsers (e.g. last one wins, first one wins) and are one of the most common causes of broken web apps
- we use this encoded dom id to be able to map back into the server side component model when actions are invoked (that is how the components find any posted data in the HTTP POST and update their values).
Message Edited by dchasman on 06-12-2008 09:08 AM
<script>
alert('{!$Component.testpage}');
alert(document);
alert(document.getElementById('{!$Component.testpage}'));//.style.backgroundColor = '#FF0000';
</script>
The alert messages are successively : "testpage", "[object HTMLDocument]" and "null", how can I make it work ? I'd like to recover an object to change its style for example.