Using jquery mobile 1.3 I was able to collect and display values from some input fields using localSotorage with this function:
<script type="text/javascript">
function datosCliente (info) {
localStorage.setItem(info.name,info.value);
}
</script>
And here is a sample of one input field calling the function:
<label for="basic">Nombre:</label>
<input type="text" name="nombre" id="basic" data-mini="true" onkeyup="datosCliente(nombre)"/>
I was hoping to do the same on an input type date:
<label for="fecha">Fecha</label>
<input name="fecha" id="fecha" type="date" data-role="datebox" data-options='{"mode":"calbox", "useNewStyle":true}' onkeyup="datosCliente(fecha)" />
And the display the value using:
<p><span>Fecha: </span><script>document.write(localStorage.getItem("fecha"));</script></p>
But is it turns out All I get is null when I want to display the value of this field. Is it because I am using the jQueryMobile - DateBox plugin to pick the date ? Or I have to try a different approach to collect the value from this type of input ?