Recent searches
No recent searches
How to set date value on the webform using javascript
Answered
Posted Oct 26, 2022
I am trying to set the date value in the webform using javascript.
$('#request_custom_fields_10113154225297').val(matchRecord.purchaseDate)
The value is displaying when I try the below code
console.log("Date "+$('#request_custom_fields_10113154225297').val())
0
5
5 comments
Ifra Saqlain
Add this to the variable:
0
Amit Chinchane
I tried the above code, but the new date is not reflecting on the webform
0
Ifra Saqlain
Can you explain more about your function (Web Form, Datepicker) ?
now , you have data (stored in this variable _z) which is showing in console.
use this _z variable and show data in the text field wherever your want.
0
Amit Chinchane
I want that after the below line of code is executed the date should be displayed in the datepicker field.
Currently it show blank.
0
Ifra Saqlain
Hi,
Add this line at the end of your script.js file and let me know
$('#request_custom_fields_10113154225297').attr('type', 'datetime-local');
Screenshot:
Output:
0