button click ... linking of 2 pages :-(((( --pls help!

J

janet

hey hi...
this in in continuation to my other post. i am trying hard
and cannot find out whats the problem. i am getting
crazy...please asp experts ...do resolve the problem...its
something very simple which i am doign wrong.
wehn i clcik to the submit button ....its absolutely dead
nothing happens!!!!!!!!!!!!!!! why so :-(((((((

this is my select.asp script:

<html>
<head>
<title> monika </title>
</head>
<body>
<form method="post" action="submit.asp">
<table><tr><td bgcolor="SILVER">
<BIG> <B> <FONT COLOR=blue>
WELCOME 'STUDENT_NAME'

TODAY IS <%=DATE()%></b></td><p></p></tr>
</table><p></p>
<input type = "text" size ="50" maxlength=90 name
= "txtStory"><p></P>
<input type="button" value="SUBMIT" >
</form>
</body>
</html>

this is my submit.asp script:
<html>
<head>
<title>monika m</title>
</head>
<body>
<%
Dim strStoryContent
DIM RSA
DIM QUERY1
DIM ConnString
DIM Conn
response.write "comes in submit"
ConnString = "Driver={MySQL ODBC 3.51 Driver};"
ConnString = ConnString & "Port=3306; "
ConnString = ConnString & "DATABASE=test; "
strStoryContent = Request.form("txtStory")

If Request.form("SUBMIT") <> "" then
response.write "come1"
If Request("txtStory")<>"" then
response.write "come2"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConnString
set RSA = Server.CreateObject("ADODB.Recordset")
QUERY1 = "INSERT INTO student_content
(student_id,story_id,status_student,story_original_story_wo
rd_count) VALUES
('1','100','draft','"&strStoryContent&"',4)"
Set rsa = conn.Execute(QUERY1)
End If
ELSE
RESPONSE.WRITE ("SUBMIT IS A ZERO LENGTH STRING")
end if
%>
</body>
</html>
 
K

Ken Schaefer

You need a "submit" input element.

<input type="submit" value="submit" name="submit"

*not*

<input type="button">

A type="button" does not submit the form.

Cheers
Ken

: hey hi...
: this in in continuation to my other post. i am trying hard
: and cannot find out whats the problem. i am getting
: crazy...please asp experts ...do resolve the problem...its
: something very simple which i am doign wrong.
: wehn i clcik to the submit button ....its absolutely dead
: nothing happens!!!!!!!!!!!!!!! why so :-(((((((
:
: this is my select.asp script:
:
: <html>
: <head>
: <title> monika </title>
: </head>
: <body>
: <form method="post" action="submit.asp">
: <table><tr><td bgcolor="SILVER">
: <BIG> <B> <FONT COLOR=blue>
: WELCOME 'STUDENT_NAME'
:
: TODAY IS <%=DATE()%></b></td><p></p></tr>
: </table><p></p>
: <input type = "text" size ="50" maxlength=90 name
: = "txtStory"><p></P>
: <input type="button" value="SUBMIT" >
: </form>
: </body>
: </html>
:
: this is my submit.asp script:
: <html>
: <head>
: <title>monika m</title>
: </head>
: <body>
: <%
: Dim strStoryContent
: DIM RSA
: DIM QUERY1
: DIM ConnString
: DIM Conn
: response.write "comes in submit"
: ConnString = "Driver={MySQL ODBC 3.51 Driver};"
: ConnString = ConnString & "Port=3306; "
: ConnString = ConnString & "DATABASE=test; "
: strStoryContent = Request.form("txtStory")
:
: If Request.form("SUBMIT") <> "" then
: response.write "come1"
: If Request("txtStory")<>"" then
: response.write "come2"
: Set Conn = Server.CreateObject("ADODB.Connection")
: Conn.Open ConnString
: set RSA = Server.CreateObject("ADODB.Recordset")
: QUERY1 = "INSERT INTO student_content
: (student_id,story_id,status_student,story_original_story_wo
: rd_count) VALUES
: ('1','100','draft','"&strStoryContent&"',4)"
: Set rsa = conn.Execute(QUERY1)
: End If
: ELSE
: RESPONSE.WRITE ("SUBMIT IS A ZERO LENGTH STRING")
: end if
: %>
: </body>
: </html>
:
:
 
J

janet

hey thanks buddy ... a sign of relief and i am on the
next page...

but still its goign to the else part. How can i use this
validation :
If Request.form("SUBMIT") <> "" then
----

this submit value is the one which i get when i click the
submit button. but still my code is not getting executed.
my 'if' condition is not getting satisfied???? why so? any
light?
 
K

Ken Schaefer

Do this (on your second page), to see what is actually in your Request.Form
collection:

<%
For Each Item in Request.Form

Response.Write(Item & " = " & Request.Form(Item) & "<br>")

Next
%>

which should give you a listing of all the different items that have been
submitted, and their values.

Cheers
Ken


: hey thanks buddy ... a sign of relief and i am on the
: next page...
:
: but still its goign to the else part. How can i use this
: validation :
: If Request.form("SUBMIT") <> "" then
: ----
:
: this submit value is the one which i get when i click the
: submit button. but still my code is not getting executed.
: my 'if' condition is not getting satisfied???? why so? any
: light?
 
J

janet

hey ken..........

superb.........

u r were abs right...
i had to make the following changes:
If Request.form("send") = "SUBMIT" then

and its working.....

i wish i cud treat u ...;-)

thanks tremendously!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,202
Latest member
MikoOslo

Latest Threads

Top