javascript - Hide input but still let JS auto fill data -
i have set of 3 input fields, take first , second input , math auto fill third input.
i don't want third input seen, using display:none
, visibility:hidden
both return nan
in out database. there anyways hide input, not autofilled data?
<div class="form-item webform-component webform-component-textfield webform-container-inline hs_total_donor_percent_change field hs-form-field total-field"> <label for="one">total donors percent change *</label> <input id="edit-submitted-acquisition-percent-change" class="form-text hs-input" name="total_donor_percent_change" readonly="readonly" size="60" maxlength="128" type="text" value="" placeholder="0"> </div>
you use hidden input field:
<input id="inputone" type="text"></input> <input id="inputtwo" type="text"></input> <input id="inputthree" type="hidden" value=""></input>
then using jquery can set value of hidden input @ whatever appropriate point like:
$('#inputthree').val("insert value here");
the hidden input pretty self explanatory, element invisible can use value
attribute data persistence.
edit: worth noting users can view source of webpage , able see value held in element's value
attribute.
Comments
Post a Comment