JQuery - 在回发时丢失下拉列表和文本框值 [英] JQuery - Losing Drop down and textbox value on postback

查看:62
本文介绍了JQuery - 在回发时丢失下拉列表和文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下拉列表选择中,我想要启用/禁用texbox和下拉列表..我使用Jquery功能,



On a dropdown list selection, I wanted a texbox and a dropdown to be enabled/disabled.. I used Jquery for functionality,

$(function() {
    $(".selectState").change(function() {
        if ($(this).find('option:selected').val() == "3") {
            alert("3");
            $(this).closest("tr").find(".ChallPrice").attr("disabled", false);
        } else {
            $(this).closest("tr").find(".ChallPrice").attr("disabled", true);
        }

    });
       });





现在点击按钮(回发),我丢失了下拉列表和文本值,它将变空。



有人可以帮忙解释如何保留回发的值



Now on a button click (postback), Im losing the dropdown and text values and it is going empty.

Can someone help on this as how to retain the values on the postback

推荐答案

(function() {
(function() {


(。selectState)。change(function(){
if(
(".selectState").change(function() { if (


(this).find('option :选中')。val()==3){
alert(3);
(this).find('option:selected').val() == "3") { alert("3");


这篇关于JQuery - 在回发时丢失下拉列表和文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆