Click to See Complete Forum and Search --> : simple form submission problem


codefinger
May 18th, 2002, 09:34 AM
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.

Sam Hobbs
May 18th, 2002, 10:46 AM
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 = ""

yossia
May 19th, 2002, 12:32 AM
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")%>"
:)

SButler
May 20th, 2002, 07:37 AM
Good catch. Going further <%=......%> is equivalent to
<%Response.Write ..... %>

Enjoy Asp...

Yalovetsky Igor
May 23rd, 2002, 12:29 AM
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:)

Yalovetsky Igor
May 23rd, 2002, 01:11 AM
Oh, I have made mistake.

default runat attribute set to client and you can't use Request object on client side:(

Bye