猿问

以下内容,在点击提交之后要让文本框的文字变成有颜色?该怎么做?

<HTML>
<BODY>
<%
mywords=Request("mywords")
mycolor=Request("mycolor")
If mycolor="RED" Then
Response.Write(<font color="#FF0000">&mywords&</font>)
Else if mycolor="GREEN" Then
Response.Write(<font color="#00FF00">&mywords&</font>)
Else
Response.Write(<font color="#00FFFF">&mywords&</font>)
End if
%>
<FORM ACTION="4-15.asp" METHOD="GET">
<INPUT TYPE="TEXT" SIZE="30" NAME="mywords" VALUE="I LIKE CHAT">
<INPUT TYPE="SUBMIT" name="submit" VALUE="提交">
字体颜色:<br>
<Input type="radio" name="mycolor" value="RED">RED
<Input type="radio" name="mycolor" value="GREEN">GREEN
<Input type="radio" name="mycolor" value="CYAN">CYAN
</FORM>
</BODY>
</HTML>
点击提交之后要让文本框的文字变成有颜色
可是现在什么都没打印出来

开满天机
浏览 237回答 2
2回答

POPMUISE

我改了一下,测试通过你可以看看<HTML><BODY><%mywords=Request("mywords")mycolor=Request("mycolor")If mycolor="RED" ThenResponse.Write("<font color='#FF0000'>"&mywords&"</font>")Elseif mycolor="GREEN" ThenResponse.Write("<font color='#00FF00'>"&mywords&"</font>")Elseif mycolor="CYAN" ThenResponse.Write("<font color='#00FFFF'>"&mywords&"</font>")End if%> <FORM ACTION="" METHOD="GET"><INPUT TYPE="TEXT" SIZE="30" NAME="mywords" VALUE="I LIKE CHAT"><INPUT TYPE="SUBMIT" name="submit" VALUE="提交">字体颜色:<br><Input type="radio" name="mycolor" value="RED">RED<Input type="radio" name="mycolor" value="GREEN">GREEN<Input type="radio" name="mycolor" value="CYAN">CYAN</FORM></BODY></HTML>我改了其中三个部分1。ELSE IF 中间去掉空格。2。多加了一个判断条件。mycolor="CYAN" Then3。输出时应该这样写,注意双引号和单引号,仔细对比一下Response.Write("<font color='#00FF00'>"&mywords&"</font>")

猛跑小猪

输出有错误Response.Write("<font color=""#FF0000"">"&mywords&"</font>")
随时随地看视频慕课网APP
我要回答