File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Portals and Portlets and the fly likes Java Script Reference to JSF components Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Reply Bookmark "Java Script Reference to JSF components" Watch "Java Script Reference to JSF components" New topic
Author

Java Script Reference to JSF components

vaitheeswaran subramanian
Greenhorn

Joined: Jan 06, 2005
Posts: 15
I am using JSF Portlet for my portlet project. I am not able to refer to the value of the faces fields through my java script.
This is the form I have
<h:form id="form1" styleClass="form">
<table>
<tbody>
<tr>
<td align="left">UserName:</td>
<td style="width:5px"> </td>
<td><h:inputText id="textUserName1"
value="#{userInfoBean.userName}" styleClass="inputText">
</h:inputText></td>
</tr>
<tr>
<td align="left">Password:</td>
<td style="width:5px"> </td>
<td><h:inputText id="textPassword1"
value="#{userInfoBean.password}" styleClass="inputText">
</h:inputText></td>
</tr>
</tbody>
</table>
<br>
<hx:commandExButton id="button1" styleClass="commandExButton"
type="submit" value="Submit">
<hx:behavior event="onclick" onActionFunction="return #{facesContext.externalContext.response.namespace}func_4(this, event);"></hx:behavior>
</hx:commandExButton>
</h:form>

My question is how would I get the values for text fields textUserName1 & textPassword1 in the java script function func_4(this, event) called when clicking the submit button?
 
 
subject: Java Script Reference to JSF components
 
Threads others viewed
JSTL and bean data
Can not Populate the form on combo box change
Foreign key field population from datatable to textbox?
Can't get c:import to work
disabled issue for inputtext
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture