[英]keep submitted values of a label text on radio button click with JQuery, C#
I Have the JQuery code following under to change text label values in a formulary. 我下面有JQuery代码来更改配方中的文本标签值。 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. 或以上的任何组合。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.