homepage Welcome to WebmasterWorld Guest from 54.234.228.64
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
submit btn doesnt respond
vanjamier




msg:956535
 6:05 am on Jan 26, 2005 (gmt 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>

 

Zaphod Beeblebrox




msg:956536
 9:47 am on Jan 26, 2005 (gmt 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.

f00sion




msg:956537
 7:47 pm on Jan 26, 2005 (gmt 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.

vanjamier




msg:956538
 1:44 am on Jan 27, 2005 (gmt 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..

duckhunter




msg:956539
 2:50 am on Jan 27, 2005 (gmt 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

vanjamier




msg:956540
 5:59 am on Jan 27, 2005 (gmt 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?

Zaphod Beeblebrox




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

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

ayeen




msg:956542
 11:49 pm on Jan 27, 2005 (gmt 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 :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved