用javascript 在客户端实现三个过程中的操作?不可以实现吗?

解决方案 »

  1.   

    DropDownlist3.onchange = function(){
      var index = DropDownlist3.selectedIndex;
      if(index == 4){
        TextBox1.disabled = false;
        DropDownList2.disabled = false;
      }
      else{
        TextBox1.disabled = true;
        DropDownList2.disabled = true;
      }
    }///我随便拿你上边的举了个例子,具体的你自己修改吧.
    你这不需要用到ASPX的,全都用客户端的JS就成了...
      

  2.   

    我也贡献一个
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META Http-Equiv="Content-Type" Content="text/html; charset=gb2312">
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    var _st = window.setTimeout;
    window.setTimeout = function(fRef, mDelay) {
    if(typeof fRef == 'function'){
    var argu = Array.prototype.slice.call(arguments,2);
    var f = (function(){ fRef.apply(null, argu); });
    return _st(f, mDelay);
    }
    return _st(fRef,mDelay);
    }
    function fAlert(x){
    alert(x);
    }
    function fDisabled(doit){
    document.all.bSave.disabled=doit;
    document.all.bCancel.disabled=doit;
    document.all.bAdd.disabled=!doit;
    }
    function fAdd(){
    fDisabled(false);
    window.setTimeout(fAlert,3000,'fason1');
    }
    function fSave(){
    fDisabled(true);
    window.setTimeout(fAlert,3000,'fason2');
    }
    function fCancel(){
    fDisabled(true);
    window.setTimeout(fAlert,3000,'fason3');
    }
    //-->
    </SCRIPT>
    </HEAD><BODY>
    <FORM METHOD=POST ACTION="">
    <INPUT TYPE="button" id="bAdd" value="Add" onclick="fAdd()">
    <INPUT TYPE="button" id="bSave" disabled value="Save" onclick="fSave()">
    <INPUT TYPE="button" id="bCancel" disabled value="Cancel" onclick="fCancel()">
    </FORM>
    </BODY>
    </HTML>
      

  3.   

    <script>
    function checkChange()
    {
    var CheckBox1 = document.getElementById("CheckBox1");
    var DropDownList1 = document.getElementById("DropDownList1");
    if(CheckBox1.checked)
    {
    DropDownList1.disabled = false;
    }
    else
    {
    DropDownList1.disabled = true;
    }
    }function list1Select()
    {
    var DropDownList1 = document.getElementById("DropDownList1");
    var DropDownList3 = document.getElementById("DropDownList3");
    var DropDownList4 = document.getElementById("DropDownList4");
    if(DropDownList1.selectedIndex != 0)
    {
    DropDownList3.disabled = false;
    DropDownList4.disabled = false;
    }
    else
    {
    DropDownList3.disabled = true;
    DropDownList4.disabled = true;
    }
    }function list3Select()
    {
    var DropDownList2 = document.getElementById("DropDownList2");
    var DropDownList3 = document.getElementById("DropDownList3");
    var TextBox1 = document.getElementById("TextBox1");
    if(DropDownList3.selectedIndex == 4)
    {
    TextBox1.disabled = false;
    DropDownList2.disabled = false;
    }
    else
    {
    TextBox1.disabled = true;
    DropDownList2.disabled = true;
    }
    }