javascript - hide() jQuery does it reset the value -


i have question when using jquery .hide() function hide input id, reset field/select value [0] or val('') or empty etc? reason ask because if user shows field, populates it, realises he/she made wrong decision on input has show/hide condition. when go hide field again, value still exist right?

what ideal way prevent unnecessary values coming through on .hide() inputs?

note: have hidden inputs pass value backend process's these form types hidden always.

the hide() function hide element (by toggling display style).

if want prevent value sent, disable input.

$('input').prop('disabled', true).hide(); 

or reactivate it

$('input').prop('disabled', false).show(); 

Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -