|
-
May 18th, 2002, 09:34 AM
#1
simple form submission problem
I'm an ASP newbie, so please bear with me:
Can anyone tell me why the message boxes are not displaying
the values in the following:
This is the form page:
http://www.bytesizedsystems.com/aspfiles/default.asp
which has a form action of director.asp.
This is the code on the director.asp page:
<%@ Language=VBScript %>
<html>
<head>
<META name=VI60_defaultClientScript content=VBScript>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</head>
<body>
<SCRIPT LANGUAGE=vbscript>
<!--
Dim radiovalue
Dim username
Dim usernumber
radiovalue = "<%Request.Form.Item("radionewcheck")%>"
username = "<%Request.Form.Item("textuserid")%>"
usernumber = "<%Request.Form.Item("textphoneno")%>"
MsgBox "Radio value is " + radiovalue
MsgBox "User Name is " + username
MsgBox "User Number is " + usernumber
-->
</SCRIPT>
</body>
</html>
Thanks in advance.
-
May 18th, 2002, 10:46 AM
#2
I have not done a lot of ASP but you could try the following.
radiovalue = "<%Request.Form.Item('radionewcheck')%>"
username = "<%Request.Form.Item('textuserid')%>"
usernumber = "<%Request.Form.Item('textphoneno')%>"
Notice the use of single-quotes within the double-quotes. If you "View Source" of the director.asp page in the client browser, it has the following:
radiovalue = ""
username = ""
usernumber = ""
-
May 19th, 2002, 12:32 AM
#3
Hi.
The problem with the code is that you missed the '=' sign when you wrote the "<%...%>" it should be "<%=...%>"
for example:
radiovalue = "<%=Request.Form.Item("radionewcheck")%>"
-
May 20th, 2002, 07:37 AM
#4
Good catch. Going further <%=......%> is equivalent to
<%Response.Write ..... %>
Enjoy Asp...
-
May 23rd, 2002, 12:29 AM
#5
It's easy.
You trying to show MessageBox on server side but not on client side.
<SCRIPT runat=client language=vbscript>
</script>
default runat attribute is server.
Have a good day
-
May 23rd, 2002, 01:11 AM
#6
Oh, I have made mistake.
default runat attribute set to client and you can't use Request object on client side
Bye
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|