a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Access Saves First Word Only in Request.Form Post

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Access Saves First Word Only in Request.Form Post
Page: [1]
 
akalana

 

Posts: 15
Joined: 10/17/2003
Status: offline

 
Access Saves First Word Only in Request.Form Post - 12/29/2004 10:23:35   
I have 3 pages. The first is a form, the second a preview page and the third is the confirmation page.
On the first form page - the user enters data into a field called body.
The user then submits through post to the preview page. Now on the preview page - there it displays whatever was passed from the form body field and display it in its entirety fine.
So on preview I have in there:
<%Response.Write Request.Form("BODY")%>
That works fine.
Now, since I want to pass this field also to the confirmation page, I have a hidden field below called:
<input type="hidden" name="BODY" value=<%Response.Write Request.Form("BODY")%>>
on the preview page.
So I have another submit button on the preview page, which when the user sees, and is satisfied with the preview- submits to the confirmation page. Now the confirmation page is just a simple insert sql statement.


vBODY=Request.Form("BODY")
strsql=INSERT INTO NOTIFICATION BODY VALUES '" & vBODY &"'

In my Access Database, I have a memo field called BODY in the notification table. The issue I'm having is the BODY field in the database only captures the first word of whatever was entered in the form's body field. So if in the form I wrote " This is a test", then the Access Database would only display in the BODY field "This". It does not capture every other word. For some reason, it is dropping the rest of the words and only saving the first word.

I was curious if there was a way around it so I still keep my preview page. Thanks in advance.
Giomanach

 

Posts: 6136
Joined: 11/19/2003
From: England
Status: offline

 
RE: Access Saves First Word Only in Request.Form Post - 12/29/2004 11:17:33   
strBody=Request.Form("BODY")

Try setting the Body info as a string variable, rather than just a variable


_____________________________




(in reply to akalana)
akalana

 

Posts: 15
Joined: 10/17/2003
Status: offline

 
RE: Access Saves First Word Only in Request.Form Post - 12/29/2004 12:37:06   
Hm..thanks..
Still giving me issues...
Is there a way to declare BODY as a string?
I did:
dim strBODY
strBODY=CStr(Request.Form("BODY")) on the preview page.
When I response.write strBODY on the preview page, it appears just fine. I also created
<input type="hidden" name="strBODY" value= <% Response.Write strBODY %>>

in hopes of passing to the confirmation page. I'm still facing the same issue. On the confirmation page, I did a response.write for the passed body field, and it only displayed the first word instead of all the BODY field text.

(in reply to Giomanach)
Giomanach

 

Posts: 6136
Joined: 11/19/2003
From: England
Status: offline

 
RE: Access Saves First Word Only in Request.Form Post - 12/29/2004 13:28:40   
quote:

<input type="hidden" name="strBODY" value= <% Response.Write strBODY %>>


Should be:

<input type="hidden" name="strBODY" value="<% Response.Write " & strBODY & " %>">

_____________________________




(in reply to akalana)
Spooky

 

Posts: 26617
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Access Saves First Word Only in Request.Form Post - 12/29/2004 13:47:05   
Like Dan says, you must quote the value.

Imagine this :
<input type="hidden" name="strBODY" value=<% Response.Write " & strBODY & " %>>

If the value is "Dave was here" then the actual output is :
<input type="hidden" name="strBODY" value=Dave was here>

When the html is parsed, the only value seen is "Dave" and the other words are treated as illegal attributes.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to Giomanach)
akalana

 

Posts: 15
Joined: 10/17/2003
Status: offline

 
RE: Access Saves First Word Only in Request.Form Post - 12/29/2004 17:23:52   
Thanks Giomanach for your response.
What I did to work was declare BODY on the preview page as:

dim BODY
BODY=CStr(Request.Form("BODY"))


Then utilize it as a hidden field:
<input type="hidden" name="BODY" value="<% Response.Write BODY %>">

When I posted to the confirmation page to write to the database,
I redeclared:
strBODY = Request.Form("BODY")
And in my insert statement:
INSERT INTO NOTIFICATION (BODY) VALUES ('" & strBODY &"')
This worked beautifully.
Thanks.

(in reply to Giomanach)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> General Web Development >> Access Saves First Word Only in Request.Form Post
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts