How to display the value a user puts into an "input="date"" box and clicks submit button using Javascript? -
i new javascript , have believe simple problem -
i have area on main page want use javascript populate date user inputs "input="date"" field on 1 page. user clicks page, puts in date , hits "submit" button, , on main page, dedicated area grabs value , displays it.
thank in advance help!
thus far have:
<div data-role="content"> content <input id="date" type="date" name="airdate"> <input name="buttonexecute" onclick="execute(document.getelementbyid('date').value);" type="button" value="execute" /> <script> var text = document.getelementbyid('date').value; </script> </div>
ok if understood correctly, want:
<div id='display'></div> <div data-role="content"> content <input id="date" type="date" name="airdate"> <input name="buttonexecute" onclick="execute(document.getelementbyid('date').value);" type="button" value="execute" /> <script> function execute (e) { var e2 = document.getelementbyid('display'); e2.innerhtml = e; } </script> </div>
example: http://jsfiddle.net/37gur/1
Comments
Post a Comment