CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  JavaScript

想用函数来控制,请帮个忙

楼主chuiyongjie(崔永杰)2005-04-03 01:45:09 在 Web 开发 / JavaScript 提问

 
  <SCRIPT   LANGUAGE=JavaScript>  
  <!--  
  function   disp()  
  {  
  exec();  
  }  
   
   
  function   exec()  
  {  
  if(check()   !=   true)  
  {  
  alert("plase   input   CustomerID");  
  exit;  
  }  
   
  document.form1.submit();  
  }  
  function   check()  
  {  
  if(document.form1.textareaCustomerID.value.length   ==   0)  
  {  
  return   false;  
  }  
  return   true  
  }  
   
  function   inputCustomerID(sts)  
  {  
              if(sts==1){  
          document.form1.textareaCustomerID.focus();  
  document.form1.textareaCustomerID.select();  
                  document.form1.filInCSVName.disabled   =   true   ;  
              }else{  
               
            document.form1.filInCSVName.focus();  
  document.form1.filInCSVName.select();  
                  document.form1.textareaCustomerID.disabled   =   false   ;  
   
          }  
   
  }  
   
  -->  
  </SCRIPT>  
   
  <HTML><HEAD><TITLE>Manager   scren</TITLE>  
  <meta   http-equiv="content-type"   content="text/html;   charset=shift_jis">  
  <meta   http-equiv="content-style-type"   content="text/css">  
  <link   rel="stylesheet"   href="../style01.css"   type="text/css"></head>  
  <body   bgcolor=#ffffff>  
  <TABLE   BORDER="1"   CELLSPACING="1"   CELLPADDING="1"   WIDTH="100%">  
  <TR>  
  <TD   bgcolor="#FFEEEE">  
  <B>message</B>  
  </TD>  
  </TR>  
   
   
  <form   name="form1"   method="post"   action="msgManageCheck.asp"   enctype="multipart/form-data">  
   
  <TABLE   WIDTH="550"   BORDER="0"   CELLSPACING="1"   CELLPADDING="1">  
   
  <tr>  
  <TD   bgcolor="#CCFFFF">  
  <FONT   SIZE="2">手順1 <b>Customer   ID</b>  
  </TD>  
  <TD   bgcolor="#CCFFFF">  
  <FONT   SIZE="2">手順2 <b>操作</b>  
  </TD>  
  </tr>  
   
  <br>  
   
  <tr>  
        <td>  
            <input   type="radio"   name="s"   onClick="inputCustomerID(1)"><font   color="#F08080">画面入力</td>  
          <td>  
            <input   type="radio"   name="s"   onClick="inputCustomerID(2)"><font   color="#F08080">file入力<br>  
          </td>  
  </tr>  
   
   
  <tr>  
  <TD   rowspan="8">  
  <TEXTAREA   name="textareaCustomerID"   cols="15"   rows="20"></TEXTAREA>  
  </TD>  
  </tr>  
   
  <tr>  
  <TD   valign="top"><BR>  
  <input   type="button"   name="subSel"   value="   表示   "   onClick="disp()">  
   
  &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<INPUT   type="file"   name="filInCSVName"   size="20">  
   
  <BR><BR> <HR>  
  </TD>  
  </tr>  
   
   
  </BODY></HTML>  
   
  ---------------------------------------------------------------------  
  在上面的画面中我想用画面入力和file入力,这两个单选框来控制文本框和文件选项框,  
  也就是说,我点击画面入力单选框时在文本框可以输入内容但是文件选项框是不能输入的状态  
  相反,我点击file入力单选框时文件选项框是激活状态,文本框是不能输入的状态  
  要实现这个功能,凭我的实力怎是不行呀,,,  
   
  帮帮我,大哥大姐们,,,  
  谢谢,, 问题点数:30、回复次数:1Top

1 楼xinyunyishui(心云意水)回复于 2005-04-03 08:46:48 得分 30

<SCRIPT   LANGUAGE=JavaScript>  
  <!--  
  function   disp()  
  {  
  exec();  
  }  
   
   
  function   exec()  
  {  
  if(check()   !=   true)  
  {  
  alert("plase   input   CustomerID");  
  exit;  
  }  
   
  document.form1.submit();  
  }  
  function   check()  
  {  
  if(document.form1.textareaCustomerID.value.length   ==   0)  
  {  
  return   false;  
  }  
  return   true  
  }  
   
  function   inputCustomerID(sts)  
  {  
              if(sts==1){            
        document.form1.textareaCustomerID.disabled   =   false;  
          document.form1.textareaCustomerID.focus();  
  document.form1.textareaCustomerID.select();  
                  document.form1.filInCSVName.disabled   =   true   ;  
              }else{  
              document.form1.filInCSVName.disabled=false;  
            document.form1.filInCSVName.focus();  
  document.form1.filInCSVName.select();  
                  document.form1.textareaCustomerID.disabled   =   true;  
   
          }  
   
  }  
   
  -->  
  </SCRIPT>  
   
  <HTML><HEAD><TITLE>Manager   scren</TITLE>  
  <meta   http-equiv="content-type"   content="text/html;   charset=shift_jis">  
  <meta   http-equiv="content-style-type"   content="text/css">  
  <link   rel="stylesheet"   href="../style01.css"   type="text/css"></head>  
  <body   bgcolor=#ffffff>  
  <TABLE   BORDER="1"   CELLSPACING="1"   CELLPADDING="1"   WIDTH="100%">  
  <TR>  
  <TD   bgcolor="#FFEEEE">  
  <B>message</B>  
  </TD>  
  </TR>  
   
   
  <form   name="form1"   method="post"   action="msgManageCheck.asp"   enctype="multipart/form-data">  
   
  <TABLE   WIDTH="550"   BORDER="0"   CELLSPACING="1"   CELLPADDING="1">  
   
  <tr>  
  <TD   bgcolor="#CCFFFF">  
  <FONT   SIZE="2">手順1 <b>Customer   ID</b>  
  </TD>  
  <TD   bgcolor="#CCFFFF">  
  <FONT   SIZE="2">手順2 <b>操作</b>  
  </TD>  
  </tr>  
   
  <br>  
   
  <tr>  
        <td>  
            <input   type="radio"   name="s"   onClick="inputCustomerID(1)"><font   color="#F08080">画面入力</td>  
          <td>  
            <input   type="radio"   name="s"   onClick="inputCustomerID(2)"><font   color="#F08080">file入力<br>  
          </td>  
  </tr>  
   
   
  <tr>  
  <TD   rowspan="8">  
  <TEXTAREA   name="textareaCustomerID"   cols="15"   rows="20"></TEXTAREA>  
  </TD>  
  </tr>  
   
  <tr>  
  <TD   valign="top"><BR>  
  <input   type="button"   name="subSel"   value="   表示   "   onClick="disp()">  
   
  &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<INPUT   type="file"   name="filInCSVName"   size="20">  
   
  <BR><BR> <HR>  
  </TD>  
  </tr>  
   
   
  </BODY></HTML>  
   
  Top

相关问题

  • 想用函数来控制,请帮个忙
  • Vb有没有控制小数精确位数的函数,帮忙~~
  • 高级控制的判断函数,不会写.请大家帮忙.
  • 请帮忙写个函数
  • 帮忙 函数有问题
  • 函数中有子函数合法吗?大家帮忙
  • vb函数改成delphi的函数,请帮忙!!!!!
  • 帮忙!帮忙!vbscript 调用JSCRIPT函数?
  • 帮帮忙,用那个API函数
  • 关于API函数,高手请帮忙。

关键词

  • 入力
  • 手順

得分解答快速导航

  • 帖主:chuiyongjie
  • xinyunyishui

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo