Welcome to WebmasterWorld Guest from 54.167.83.224

Forum Moderators: ocean10000

Message Too Old, No Replies

submit btn doesnt respond

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

Junior Member

10+ Year Member

joined:Nov 18, 2004
posts:47
votes: 0


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" -->
<HTML>
<HEAD>
<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>
</HEAD>
</HEAD>
<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
OpenDatabase()

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

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

Response.write "SQL = "&sqlstr
Response.Flush
Response.End
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>
<HR>

<center><STRONG>Personal Particulars</STRONG> <BR></center>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&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>
</SELECT><BR><FONT
color=blue size=1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<FONT size=2>as in Active Directory</FONT>

</FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Department: <INPUT size=16 name=department onKeyPress="if (event.keyCode < 65 ¦¦ event.keyCode > 122) event.returnValue = false;"> Cost
Center: <INPUT size=5 name=center>
<P></P>
<DIV></DIV>
<DIV align=center></DIV>
<DIV align=center>
<HR>
<DIV align=center>
</DIV>
<BR>Remarks : <INPUT size=45 name=remarks><BR></DIV>
<DIV align=center>
<TABLE cellSpacing=2 cellPadding=2 align=center>
<TR>
<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>
<form method="post" action="admin_view.asp" id=form2 name=form2>
<P align=center><INPUT type=submit value=Back name=submit2></P></form>
</BODY>
</HTML>

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

Junior Member

10+ Year Member

joined:Aug 31, 2003
posts:196
votes: 0


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)

Junior Member

10+ Year Member

joined:Aug 7, 2002
posts:97
votes: 0


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)

Junior Member

10+ Year Member

joined:Nov 18, 2004
posts:47
votes: 0


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)

Preferred Member

10+ Year Member

joined:Oct 28, 2002
posts:506
votes: 0


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)

Junior Member

10+ Year Member

joined:Nov 18, 2004
posts:47
votes: 0


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?

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

Junior Member

10+ Year Member

joined:Aug 31, 2003
posts:196
votes: 0


If Request.Form("CaseInsensitiveName") = "CaseSensitiveValue" Then...
11:49 pm on Jan 27, 2005 (gmt 0)

New User

10+ Year Member

joined:Jan 25, 2005
posts:5
votes: 0


hello there vanjamier!

Below is my suggestion :

<%

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

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

end if
%>

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

Department ....
.....
.....

<INPUT TYPE="SUBMIT" VALUE="Submit" name=SUBMIT>

</form>

</body>
</html>

Hope this help :)