Form Won't Submit

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 11 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
rcandela
Posts: 6
Last visit: Thu Sep 13, 2012 4:10 am

Form Won't Submit

Post by rcandela »

I'm having troubles getting this form to work. I've dumped my entire asp page on here - but it just won't submit. I've verified that everything lines up with SQL - is there something wrong with the form?

Code: Select all

	Dim QUERY_STRING_INFO  
	QUERY_STRING_INFO = Replace(Request.QueryString("Id"), "{", "'")
	QUERY_STRING_INFO = Replace(QUERY_STRING_INFO, "}", "'")
	SQLString = "SELECT * FROM CRMLead WHERE Id = '" & request.QueryString("Id") & "';"
	Set rsUsersMod = Server.CreateObject("ADODB.Recordset")
	'Then open the record we want
	rsUsersMod.Open SQLString,dbConn,adLockReadOnly,adOpenDynamic
	
	SQLStringLeads = "SELECT * FROM CRMTask WHERE WhoId ='" & request.QueryString("Id") & "' ORDER BY ActivityDate DESC;"   
	Set rsTasks = Server.CreateObject("ADODB.Recordset")	
	rsTasks.Open SQLStringLeads,dbConn,adLockReadOnly,adOpenDynamic
	
	':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
	' Update data into orders table
	'First check the user input and the action selected
	If Request.Form("update") = "modifylead" Then
		strSQL ="UPDATE CRMLead SET " &_
				"FirstName = '" & Request.Form("FirstName") & "', " &_
				"LastName = '" & Request.Form("LastName") & "', "  &_
				"Email = '" & Request.Form("Email") & "', " &_
				"Company = '" & Request.Form("Company") & "', " &_
				"Street = '" & Request.Form("Street") & "', " &_
				"City = '" & Request.Form("City") & "', " &_
				"State = '" & Request.Form("State") & "', " &_
				"PostalCode = '" & Request.Form("PostalCode") & "', " &_
				"Phone = '" & Request.Form("Phone") & "', " &_
				"WHERE Id = '" & Request.Form("recordid") & "';"
				dbConn.Execute(strSQL)
				IF ((Session("Level") = "Admin")) Then
				ErrorMess = "Information Has Been Updated!"
				Else
				Response.Redirect("crm_user.asp?id=" & rsUsersMod.Field.Item("Id").Value & "")
				End If
	End If
	
	 
	
	
	
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Form Won't Submit

Post by jvierra »

Please post the code as a file attachment.

I will look at it but this is not really an ASP forum. We should have a section here for web where it is realated to Sapien tools as PrimalScript edits ASP quite nicely.

I recommend getting the sql into a function that you can run at a commandline until you get it to work correctly. Once it is working as a VBScritp then you can port it to ASP. ASP is tricky beciuse the web server generally cannot touch the database server. You are also portint values from a web form that are not being bounds checked. This can lead to and will almost certainly lead to a sql-injection attack.

Here is an example of how to start this as an attached file.

Your SQL is wrong and will not work anywhere. What you are trying to do is also almost impossible to determine fromteh code you posted.


Attached files /FileUpload/b1/c2873ec81ff9b5a9892665d2e32d95.txt (846 B)
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Form Won't Submit

Post by jvierra »

Well I tried to attach a file but it won';t work until they fix the forum software.

Here is a link to a file with an example of how to proceed.

http://www.designedsystemsonline.com/up ... script.txt
User avatar
Ferdinand Rios
Posts: 373
Last visit: Fri Sep 16, 2022 1:24 pm

Form Won't Submit

Post by Ferdinand Rios »

The file attached fine. I see it with no problem. What issues with attachments are you experiencing?
F.G. Rios
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Form Won't Submit

Post by jvierra »

Are you talking about the link above or the file that looks like a piece of paper with the corner folded down?

The file appears to be there but it cannot be downloaded. Nothiing happens when it is clicked on
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Form Won't Submit

Post by Alexander Riedel »

I click on the link as shown and the file opens just fine....


Attached files
Alexander Riedel
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Form Won't Submit

Post by jvierra »

Ok - the file I uploaded was a Unicode file. It would not display in IE8 on XP. I deleted it and uploaded an ansi version and now it displays correctly.

Maybe it was just that the file was corrupted. I could right click and select "Save Target As" and I could right-click and choose "OPen" but the file would not act like a hyperlink and disply as long as it was a Unicode file.

I think thsi meansd that you Mime typyes are no all set on the web server. A TXT extension can be Unicode and should be allowed as mime/text. Older web servers may not have that enabled or it may not be enabled because a server was upgraded in place from IIS6
This topic is 11 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked