Welcome to WebmasterWorld Guest from

Forum Moderators: ocean10000

Message Too Old, No Replies

submit btn doesnt respond



6:05 am on Jan 26, 2005 (gmt 0)

10+ Year Member

Hi all,

My submit button wont work...
I wanna view to see if the strsql is correct but the button doesnt work...
Dont understand what is WRONG..
always happens argh..
Hope someone can point out the problem.. thanks in advance.

<%@ Language=VBScript %>
<!-- #include file="include/connections/database.inc" -->
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script language="javascript" src=".\include\date-picker.js"></script>
<script language="JavaScript" src=".\include\checkfield.js"></script>
<BODY link="white" alink="white" vlink="white">
<form onsubmit="return verify()" name=form1 method="post" action="admin_add.asp" enctype="multipart/form-data">
If Request.Form("submit")="submit" Then

Set rs = Server.CreateObject("ADODB.RecordSet")

strName = Request.Form("name")
strloginId = Request.Form("loginId")
strlogin = Request.Form("login") 'combobox
strdepartment = Request.Form("department")
strcenter = Request.Form("center")
strremarks = Request.Form("remarks")

'open the database from database.inc file

'RecordSet Object
Set rs = CreateObject("ADODB.RecordSet")

strsql = "INSERT INTO sunder.mobile_users " &_
"VALUES ('" & strName & "', '" & strloginId & "', '" & strlogin & "', '" & strdepartment & "', '" & strcenter & "')"

Response.write "SQL = "&sqlstr
End If

<P align=center><STRONG><FONT color=red>Application Form For New Mobile User</FONT></STRONG></P>
<FONT color=black><STRONG>Please fill out the particulars:</STRONG>

<center><STRONG>Personal Particulars</STRONG> <BR></center>
&nbsp;Name: <INPUT size=14 name=name onKeyPress ="if (event.keyCode < 65 ¦¦ event.keyCode > 122) event.returnValue = false;">&nbsp;&nbsp;&nbsp;&nbsp;Win2k Login Id: <INPUT size=15 name=loginId onKeyPress ="if (event.keyCode < 65 ¦¦ event.keyCode > 122) event.returnValue = false;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Login Type: <SELECT name=login>
<option value="super">Super
<option value="normal" selected>Normal
<option value="Admin">Admin</option>
color=blue size=1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<FONT size=2>as in Active Directory</FONT>

Department: <INPUT size=16 name=department onKeyPress="if (event.keyCode < 65 ¦¦ event.keyCode > 122) event.returnValue = false;"> Cost
Center: <INPUT size=5 name=center>
<DIV align=center></DIV>
<DIV align=center>
<DIV align=center>
<BR>Remarks : <INPUT size=45 name=remarks><BR></DIV>
<DIV align=center>
<TABLE cellSpacing=2 cellPadding=2 align=center>
<TD><INPUT type=reset value=Reset id=reset1 name=reset1></TD>
<TD><INPUT type=submit value=Submit name=submit></TD></TR></TABLE></FONT></DIV>
<form method="post" action="admin_view.asp" id=form2 name=form2>
<P align=center><INPUT type=submit value=Back name=submit2></P></form>

Zaphod Beeblebrox

9:47 am on Jan 26, 2005 (gmt 0)

10+ Year Member

First, get rid of the &nbsp;s.

Second, the line <form onsubmit="return verify()" suggests there is a javascript function called verify which prevents your form from being submitted.


7:47 pm on Jan 26, 2005 (gmt 0)

10+ Year Member

your verify() function is most likely returning false..remove that and see if it works, then check the function for what is going wrong.


1:44 am on Jan 27, 2005 (gmt 0)

10+ Year Member

Hi guys thanks for replying...

I removed the return verify and the javascript but the button still wont work..?!
How come ..?

About the &nbsp.. it was generated by the program not me..


2:50 am on Jan 27, 2005 (gmt 0)

10+ Year Member

The value of your Submit is case sensitive
I believe it should be a capital S as in your value=Submit:

If Request.Form("submit")="Submit" Then


5:59 am on Jan 27, 2005 (gmt 0)

10+ Year Member

Oh okay..
thats one error. Another one is the string i declared...~
i declared strsql but i used sqlstr....damn

I would like to clarify..
So its type = Value , is it?

Request.Form("submit")="submit" Then

or is it , name = Value?

Zaphod Beeblebrox

9:48 am on Jan 27, 2005 (gmt 0)

10+ Year Member

If Request.Form("CaseInsensitiveName") = "CaseSensitiveValue" Then...


11:49 pm on Jan 27, 2005 (gmt 0)

10+ Year Member

hello there vanjamier!

Below is my suggestion :


if request.querystring("submit") = "true" then

Set rs = Server.CreateObject("ADODB.RecordSet")

end if

<form NAME="form1" METHOD="POST" ACTION="admin_add.asp?submit='true'">

Department ....




Hope this help :)


Featured Threads

Hot Threads This Week

Hot Threads This Month