How can I represent
document.getElementById('page1:form2:amount')
in jQuery
I know I can use
$('#amount')
to access the id amount.
The id amount is an <apex:inputText/>
type which is how an input text is represented in the Visualforce page. To access this id I would need to use the hierarchy of page->form->id.
Thanks
Prady
Update: Code used in Visualforce page.
<apex:page controller="acontroller" id="page1">
<apex:form id="form2">
<apex:inputText value="{!amt}" id="amount" onchange="calenddate();"/>
</apex:form>
</apex:page>
what you can do is get the form instance and find all the input type text(not necessary) and get the id attribute from the instance
<form id="myform">
<input type="text" value="hello1" id="1">
<input type="text" value="hello2" id="2">
<input type="text" value="hello3" id="3">
<input type="text" value="hello4" id="4">
</form>
$('#myform > input[type="text"]').each(function(key,value){
$(value).attr('id');
})
and as of your server-side code, anyways it will be converted to standard HTML format on client side and javascript will read the final HTML tags only. so go to source and find what exactly is the replacment for and then use that tag to be searched in the jQuery function