I Have the JQuery code following under to change text label values in a formulary. But on submit them(if have an invalid filled field), the text label values returns of the original value. How can i keep these values for not fill the fields again?
<script type="text/javascript">
$(document).ready(function () {
$('input:radio').change(function () {
var rbvalue = $('input:radio:checked').val();
if (rbvalue === "D") {
$('#idCard').html('IC:');
$('#userName').html('User Name: ');
$('#completeName').html('Complete Name: ');
$('#userAdress').html('User Adress: ');
}
else if (rbvalue === "B") {
$('#publicId').html('Public Identificator: ');
$('#publicName').html('Public Name: ');
$('#publicCompleteName').html('Public Complete Name: ');
$('#publicAdress').html('Public Adress: ');
}
});
});
</script>
You can:
Or any combination of the above.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.