jquery - primefaces calendar value is undefined in javascript -
jquery - primefaces calendar value is undefined in javascript -
i seek primefaces calendar value in javascript xhmtl page on below set javascript metod startprint() phone call metod onclick action calendar value undefined same thing works h:inputhidden guess problem on p:calendar component
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head> <meta content='text/html; charset=utf-8' http-equiv="content-type"/> </h:head> <h:body> <h:form> <p:calendar id="datesr" value="#{protocolcnt.detail.prcreatedate}" pattern="dd-mm-yyyy"/> <p:commandbutton value="Çap et" style="margin-left: 30px" onclick="startprint()" icon="ui-icon-printprt"/> <h:outputscript library="javascript" name="printjs.js" /> </h:form> </h:body> </html>
console output: datesr undefined printjs.js?ln=javascript:35
class="lang-js prettyprint-override">function startprint() { var datesr = document.getelementbyid('datesr').value; console.log('datesr ' + datesr); }
thanks in advance.
use getdate()
of primefaces.widget.calendar
<p:calendar widgetvar="calendarwv"> </p:calendar>
javascript
pf('calendarwv').getdate()
javascript jquery jsf primefaces calendar
Comments
Post a Comment