473,748 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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><t d 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={My SQL ODBC 3.51 Driver};"
ConnString = ConnString & "Port=3306; "
ConnString = ConnString & "DATABASE=t est; "
strStoryContent = Request.form("t xtStory")

If Request.form("S UBMIT") <> "" then
response.write "come1"
If Request("txtSto ry")<>"" then
response.write "come2"
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Open ConnString
set RSA = Server.CreateOb ject("ADODB.Rec ordset")
QUERY1 = "INSERT INTO student_content
(student_id,sto ry_id,status_st udent,story_ori ginal_story_wo
rd_count) VALUES
('1','100','dra ft','"&strStory Content&"',4)"
Set rsa = conn.Execute(QU ERY1)
End If
ELSE
RESPONSE.WRITE ("SUBMIT IS A ZERO LENGTH STRING")
end if
%>
</body>
</html>
Jul 19 '05 #1
4 2864
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

"janet" <kn*******@hotm ail.com> wrote in message
news:02******** *************** *****@phx.gbl.. .
: 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><t d 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={My SQL ODBC 3.51 Driver};"
: ConnString = ConnString & "Port=3306; "
: ConnString = ConnString & "DATABASE=t est; "
: strStoryContent = Request.form("t xtStory")
:
: If Request.form("S UBMIT") <> "" then
: response.write "come1"
: If Request("txtSto ry")<>"" then
: response.write "come2"
: Set Conn = Server.CreateOb ject("ADODB.Con nection")
: Conn.Open ConnString
: set RSA = Server.CreateOb ject("ADODB.Rec ordset")
: QUERY1 = "INSERT INTO student_content
: (student_id,sto ry_id,status_st udent,story_ori ginal_story_wo
: rd_count) VALUES
: ('1','100','dra ft','"&strStory Content&"',4)"
: Set rsa = conn.Execute(QU ERY1)
: End If
: ELSE
: RESPONSE.WRITE ("SUBMIT IS A ZERO LENGTH STRING")
: end if
: %>
: </body>
: </html>
:
:
Jul 19 '05 #2
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("S UBMIT") <> "" 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?
-----Original Message-----
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

"janet" <kn*******@hotm ail.com> wrote in message
news:02******* *************** ******@phx.gbl. ..
: 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><t d 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={My SQL ODBC 3.51 Driver};"
: ConnString = ConnString & "Port=3306; "
: ConnString = ConnString & "DATABASE=t est; "
: strStoryContent = Request.form("t xtStory")
:
: If Request.form("S UBMIT") <> "" then
: response.write "come1"
: If Request("txtSto ry")<>"" then
: response.write "come2"
: Set Conn = Server.CreateOb ject("ADODB.Con nection")
: Conn.Open ConnString
: set RSA = Server.CreateOb ject("ADODB.Rec ordset")
: QUERY1 = "INSERT INTO student_content
: (student_id,sto ry_id,status_st udent,story_ori ginal_story_wo: rd_count) VALUES
: ('1','100','dra ft','"&strStory Content&"',4)"
: Set rsa = conn.Execute(QU ERY1)
: End If
: ELSE
: RESPONSE.WRITE ("SUBMIT IS A ZERO LENGTH STRING")
: end if
: %>
: </body>
: </html>
:
:
.

Jul 19 '05 #3
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(It em) & "<br>")

Next
%>

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

Cheers
Ken
"janet" <kn*******@hotm ail.com> wrote in message
news:03******** *************** *****@phx.gbl.. .
: 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("S UBMIT") <> "" 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?
Jul 19 '05 #4
hey ken..........

superb.........

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

and its working.....

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

thanks tremendously!
-----Original Message-----
Do this (on your second page), to see what is actually in your Request.Formcollection:

<%
For Each Item in Request.Form

Response.Write( Item & " = " & Request.Form(It em) & "<br>")
Next
%>

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

Cheers
Ken
"janet" <kn*******@hotm ail.com> wrote in message
news:03******* *************** ******@phx.gbl. ..
: 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("S UBMIT") <> "" 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?
.

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.