|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
button click ... linking of 2 pages :-((((
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_word_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> |
|
#2
|
|||
|
|||
|
try
Code:
<input type="submit" value="SUBMIT" > instead of Code:
<input type="button" value="SUBMIT" > tom |
|
#3
|
|||
|
|||
|
a little progress
hey thanks.....
this really helped... it comes to the other page at least. thanks. though its not executing the code but at least some progress. in the else page its goign to the else part: can u help me why is it so? <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> Last edited by aspuser25 : August 20th, 2003 at 03:17 AM. |
|
#4
|
|||
|
|||
|
Code:
Request.form("SUBMIT")
will be empty, this form-element doesn't exist in your form. use Code:
<input type="submit" name="send" value="SUBMIT" > and then you can request the value with Code:
Request.Form("send")
a little advice: use also the name attribute in your form-tag. |
|
#5
|
|||
|
|||
|
stilll no effect
i tried what u said...it made a lot of sense. pls see code below:
but still its goign to else condition. i also tried If Request.form("send") then am i putting a correct condition??? pls advise thanks <html> <head> <title>sdad</title> </head> <body> <% Dim strStoryContent DIM RSA DIM QUERY1 DIM ConnString DIM Conn dim var1 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("send") <> "" 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_word_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> |
|
#6
|
|||
|
|||
|
i fianlly resolved the problem....hey thanks all ......
i simply had to put this condition: If Request.form("send") = "SUBMIT" then i am really thankful to u all .... gr8 help... otherwise i wud have been struggling all way.. ![]() |
|
#7
|
|||
|
|||
|
if you you use
Code:
If Request.form("send") then
a boolean value is expected. ok, try this Code:
If Request.form("send")&"" <> "" then
before you go to the condition you also can print the value of Request.form("send") for debugging, so you can see, if the value is posted correctly. if it's not, you'll have to search the bug in your form... tom |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > button click ... linking of 2 pages :-(((( |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|