posted 5 years ago
Hi All,
If anyone have such problem, I've found a solution that worked for me.
use an id for the form like
Then for the button add an onClick event as below
<input type="button" value="Submit Form" onclick="getLastDate()" />
and in the javascript in <head>, use the below method. Make sure that the method name is same as the onClick event attribute value.
Here i need to fill a text box with current time, so i used the below code, you have to change as per your requirement.
This is solution for my first question.
For time delay i.e. my second question.
Use a setTimeout method in javascript as below. Here 3000 means 3 seconds.
This has to be given wherever you want a time delay,
In my case, i need to get the time in text box, pause it and then submit the form data, so i took this after the time is fetched (please refer to my third code block for full js method).
This is how I've solved my problem.
Cheers,
Rakesh