Problem with form! HELP Please!!!

This is a discussion on "Problem with form! HELP Please!!!" within the Classic ASP section. This forum, and the thread "Problem with form! HELP Please!!! are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack (1) Thread Tools
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old Aug 30th, 2005, 18:12
New Member
Join Date: Aug 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Problem with form! HELP Please!!!

Here is the code
[code]
<script type="text/javascript" language="JavaScript1.2" src="../assets/creditform.js"></script>
<%
connection = "Data Source=" & Server.Mappath("../_private/credit.mdb") & ";Provider=Microsoft.Jet.OLEDB.4.0;"
Set objconn = Server.CreateObject("ADODB.Connection")
objconn.Open connection
%>
<%

set session("dataID") = request.form("dataID")
on error resume next

dim dat_id
dim new_name
dim new_desc
dim new_disputes
dim FormSubmit

dat_id = Request.form("dataID")
new_name = Request.form("name")
new_desc = Request.form("desc")
new_disputes = Request.form("disputes")
submit = Request.form("Postback")

function main()

If FormSubmit <> "" Then
with response
If dat_id = "" Then
.Write "<body onLoad='error0()>" & vbcrlf

End If

If Not IsNumeric(dat_id) Then
.Write "<body onLoad='error1()>" & vbcrlf

End If






updateDataSQL = "UPDATE datas SET dat_name = '" & new_name & "'," _
& " dat_description = '" & new_desc & "'" _
& " WHERE dat_id = " & dat_id
objconn.Execute updateDataSQL

deleteSQL = "DELETE FROM mydisputes WHERE dat_id = " & dat_id

.Write "<HR>DEBUG deleteSQL: " & deleteSQL & "<HR>"

objconn.Execute deleteSQL ' DO IT


updateDisputesSQL = "INSERT INTO mydisputes (dat_id, dispute_id) " _
& " SELECT " & dat_id & ", id FROM disputes " _
& " WHERE id IN (" & new_disputes & ")"

.Write "<HR>DEBUG updateDisputesSQL: " & updateDisputesSQL & "<HR>"

objconn.Execute updateDisputesSQL ' DO IT


End If


getMainSQL = "SELECT * FROM datas WHERE dat_id = " & dat_id
Set RS = objconn.Execute( getMainSQL )
If RS.EOF Then
.Write "<body onLoad='error2()'>" & vbcrlf

End If
' show the basic info:
%>

<FORM name="customerContents" action="test.asp?submitted=true"
method="post">
DATA ID: <input type="text" name="dataID"
value="<%=session.contents("dataID")%>" maxlength="20" size="20">

NAME: <INPUT Name="name" Value="<%=RS("dat_name")%>">

DESCRIPTION: <INPUT Name="desc" Value="<%=RS("dat_description")%>">

DISPUTES:

<%



disputeSQL = "Select D.ID, IIF(ISNULL(M.dispute_id),'','CHECKED') AS CHK,
D.U_Disputes " _
& " FROM disputes AS D LEFT JOIN mydisputes AS M " _
& " ON ( D.id = M.dispute_id AND M.dat_id = " & dat_id & ") " _
& " ORDER BY D.u_disputes"

.Write "<HR>DEBUG disputeSQL: " & disputeSQL & "<HR>"

Set RS = objconn.Execute(SQL)
count = 0
CONST CBS_PER_LINE = 2 ' if you have room, make it 3 checkboxes per line
Do Until RS.EOF
%>
<INPUT TYPE="CHECKBOX" Name="disputes" VALUE="<%=RS("id")%>" <%=RS("chk")%>
> <%=RS("U_Disputes")%>
<%
x = x + 1
If x MOD CBS_PER_LINE = 0 Then .Write "
"
RS.MoveNext
Loop
end if
end with
end function

RS.close
set RS = nothing
objconn.close
set objconn = nothing
set disputeSQL =nothing
set updateDataSQL = nothing
set deleteSQL = nothing
set updateDisputesSQL = nothing
set SQL = nothing
set CBS_PER_LINE = nothing
set dat_id = nothing
set new_name = nothing
set new_desc = nothing
set new_disputes = nothing

%>
<div align="center">
<INPUT Type="Submit" Name="Postback" Value="Submit changes"></div>
</FORM>
[code]

And this is the error:
Microsoft VBScript compilation (0x800A0405)
Expected 'With'
/myweb/ducredit/includes/test.asp, line 69, column 4
End If


Any ideas???
Reply With Quote

  #2 (permalink)  
Old Aug 30th, 2005, 19:39
New Member
Join Date: Aug 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
I found where the problem was:

objconn.Execute updateDisputesSQL ' DO IT
End With
End If

but when I do this i get this next error message

Microsoft VBScript compilation (0x800A0409)
Unterminated string constant
/myweb/ducredit/includes/test.asp, line 91, column 73
disputeSQL = "Select D.ID, IIF(ISNULL(M.dispute_id),'','CHECKED') AS CHK,

I need help terminating this string

<%

disputeSQL = "Select D.ID, IIF(ISNULL(M.dispute_id),'','CHECKED') AS CHK,
D.U_Disputes " _
& " FROM disputes AS D LEFT JOIN mydisputes AS M " _
& " ON ( D.id = M.dispute_id AND M.dat_id = " & dat_id & ") " _
& " ORDER BY D.u_disputes"

.Write "<HR>DEBUG disputeSQL: " & disputeSQL & "<HR>"

Set RS = objconn.Execute(SQL)
count = 0
CONST CBS_PER_LINE = 2 ' if you have room, make it 3 checkboxes per line
Do Until RS.EOF
%>
Reply With Quote
  #3 (permalink)  
Old Aug 30th, 2005, 21:06
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
I'm pretty sure you can't use WITH in the way you're trying to.

Just delete the with and end with and put Response back in the places where it's needed.
Reply With Quote
Reply

Tags
problem, form, help

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.webforumz.com/classic-asp/3114-problem-with-form-help-please.htm
Posted By For Type Date
assets script js Post #1 Refback Oct 30th, 2006 15:59

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with my form script? GeekyBabe PHP Forum 4 Jan 30th, 2008 23:10
HTML form problem voodoo465 Web Page Design 4 Sep 27th, 2007 15:13
Problem with results of form Otter PHP Forum 2 Nov 7th, 2006 13:35
Problem with Form Submission Page NewDesigner Web Page Design 4 Oct 6th, 2006 09:36
Pls help with this form problem DavidinLondon PHP Forum 1 Jun 14th, 2006 16:45


All times are GMT. The time now is 15:33.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43