想用函数来控制,请帮个忙
<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()">
          <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()">
          <INPUT type="file" name="filInCSVName" size="20">
<BR><BR> <HR>
</TD>
</tr>
</BODY></HTML>
Top




