Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to extract value from inputtext of JSF page using JavaScript
    primarykey
    data
    text
    <p>hello everyone i am try to extract value from the field of a JSF page using document.getElementById("someid") </p> <p>here is the actual code</p> <pre><code> &lt;h:form id="hell"&gt; &lt;h:panelGrid columns="12" border="0"&gt; &lt;h:outputLabel&gt;Airlines&lt;/h:outputLabel&gt; &lt;h:selectOneMenu value="#{planeMngr.PM.airline_no}" styleClass="inputbox" style="width:150px"&gt; &lt;f:selectItems value="#{projectUtil.airlineList}" var="AList" itemLabel="#{AList.name}" itemValue="#{AList.name}"/&gt; &lt;/h:selectOneMenu&gt; &lt;h:outputLabel&gt;Source&lt;/h:outputLabel&gt; &lt;h:selectOneMenu value="#{planeMngr.PM.source}" styleClass="inputbox" style="width:150px"&gt; &lt;f:selectItems value="#{projectUtil.contyList}" var="RList" itemLabel="#{RList.country_Name}" itemValue="#{RList.country_Name}"/&gt; &lt;/h:selectOneMenu&gt; &lt;h:outputLabel&gt;Destination&lt;/h:outputLabel&gt; &lt;h:selectOneMenu value="#{planeMngr.PM.destination}" styleClass="inputbox" style="width:150px"&gt; &lt;f:selectItems value="#{projectUtil.contyList}" var="RList" itemValue="#{RList.country_Name}"/&gt; &lt;/h:selectOneMenu&gt; &lt;h:outputLabel&gt;Departure Date&lt;/h:outputLabel&gt; &lt;h:inputText id ="depday" value="#{planeMngr.PM.departure_date}" label="dd/mm/yyyy" &gt; &lt;f:convertDateTime pattern="dd/MM/yyyy" dateStyle="full" &gt;&lt;/f:convertDateTime&gt; &lt;/h:inputText&gt; &lt;h:outputLabel&gt;Departure Time &lt;/h:outputLabel&gt; &lt;h:inputText id="deptime" value="#{planeMngr.PM.departure_time}" label="HH:MM" &gt; &lt;f:convertDateTime pattern="HH:mm"&gt;&lt;/f:convertDateTime&gt; &lt;/h:inputText&gt; &lt;h:outputLabel value="Status"/&gt; &lt;h:selectOneMenu label="Status" value="#{planeMngr.PM.status}"&gt; &lt;f:selectItem itemLabel="PreFlight" itemValue="PreFlight" /&gt; &lt;f:selectItem itemLabel="Open" itemValue="Open" /&gt; &lt;f:selectItem itemLabel="Restricted CheckIn" itemValue="Restricted_CheckIn" /&gt; &lt;f:selectItem itemLabel="Restricted" itemValue="Restricted" /&gt; &lt;f:selectItem itemLabel="Closed" itemValue="Closed" /&gt; &lt;f:selectItem itemLabel="Released" itemValue="Released" /&gt; &lt;/h:selectOneMenu&gt; &lt;/h:panelGrid&gt; &lt;h:commandButton onclick="return datevalidate()" action="#{planeMngr.ADD}" value="save" &gt;&lt;/h:commandButton&gt; &lt;/h:form&gt; </code></pre> <p>here is my JS code. in which i am just checking what are the value in the field that is filled by user.</p> <pre><code> function datevalidate() { var dat = document.getElementById("hell:deptime"); var day = document.getElementById("hell:depday"); alert(dat +" time "+day); // this gives "[object HTMLInputElement] time [object HTMLInputElement]" as an out put return false; } </code></pre> <p>tell me what i am doing wrong here?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload