carriage return being strangely added when I perform a standard post

C

Charles Gamble

Hi,
I am performing a post from one classic ASP page to another in order
to get the value of a string passed between the two pages. I have a
client script variable declared to take the value of the value being
received in the page i.e. var x = '<%=varName%>'. Unfortunately, ASP
seems to be adding a carriage return to the value of varName when it
is passed in i.e. it expands the stated line to var x = 'FieldContents
';. I.e. somewhere a carriage return has been added. The string gets
passed in OK if I use the Get mechanism. Don't know why this carriage
return is being added when using Post mechanism. Anybody seen this
before? Is it a bug in ASP ?
 
C

Charles Gamble

Thanks for the interest Rob.
Here is the form section of The calling file that is posting the
request:
<form id=RefreshPageParams name=RefreshPageParams action="Jobs.asp"
method = POST>
<INPUT type="hidden" value="" id=DefnName name=DefnName>
<INPUT type="hidden" value="" id=SearchXML name=SearchXML>
<INPUT type="hidden" value="" id=PreviousJobSearchXML
name=PreviousJobSearchXML>
<INPUT type="hidden" value="" id=PreviousJobMetaSearchXML
name=PreviousJobMetaSearchXML>
<INPUT type="hidden" value="" id=SearchType name=SearchType>
<INPUT type="hidden" value="" id=awfsessionid name=awfsessionid>
<INPUT type="hidden" value="" id=CreationType name=CreationType>
<INPUT type="hidden" value="" id=isMetaSearch name=isMetaSearch>
<INPUT type="hidden" value="" id=PreviousJobSearchType
name=PreviousJobSearchType>

</form>

Here is the code that submits the form:
//update our parameters form before we refresh
RefreshPageParams.DefnName.value = sDefnName;
RefreshPageParams.SearchXML.value = sTheSearchXML;
RefreshPageParams.PreviousJobSearchXML.value = sPreviousSearchXML;
RefreshPageParams.PreviousJobMetaSearchXML.value =
sPreviousMetaSearchXML;
RefreshPageParams.SearchType.value = SearchTypeIndicator;
RefreshPageParams.awfsessionid.value = sSessionID;
RefreshPageParams.CreationType.value ="<%=jobsearch%>";
RefreshPageParams.PreviousJobSearchType.value = sPrevJobSearchType;
RefreshPageParams.isMetaSearch.value = isMetaSearch;


RefreshPageParams.submit();

Regarding the receiving page, here is the code that receives the string
that unfortuatley contains a carriage return:
SearchXML = Request("SearchXML")
 
R

Roland Hall

in message
: Thanks for the interest Rob.
: Here is the form section of The calling file that is posting the
: request:
: <form id=RefreshPageParams name=RefreshPageParams action="Jobs.asp"
: method = POST>
: <INPUT type="hidden" value="" id=DefnName name=DefnName>
: <INPUT type="hidden" value="" id=SearchXML name=SearchXML>
: <INPUT type="hidden" value="" id=PreviousJobSearchXML
: name=PreviousJobSearchXML>
: <INPUT type="hidden" value="" id=PreviousJobMetaSearchXML
: name=PreviousJobMetaSearchXML>
: <INPUT type="hidden" value="" id=SearchType name=SearchType>
: <INPUT type="hidden" value="" id=awfsessionid name=awfsessionid>
: <INPUT type="hidden" value="" id=CreationType name=CreationType>
: <INPUT type="hidden" value="" id=isMetaSearch name=isMetaSearch>
: <INPUT type="hidden" value="" id=PreviousJobSearchType
: name=PreviousJobSearchType>
:
: </form>
:
: Here is the code that submits the form:
: //update our parameters form before we refresh
: RefreshPageParams.DefnName.value = sDefnName;
: RefreshPageParams.SearchXML.value = sTheSearchXML;
: RefreshPageParams.PreviousJobSearchXML.value = sPreviousSearchXML;
: RefreshPageParams.PreviousJobMetaSearchXML.value =
: sPreviousMetaSearchXML;
: RefreshPageParams.SearchType.value = SearchTypeIndicator;
: RefreshPageParams.awfsessionid.value = sSessionID;
: RefreshPageParams.CreationType.value ="<%=jobsearch%>";
: RefreshPageParams.PreviousJobSearchType.value = sPrevJobSearchType;
: RefreshPageParams.isMetaSearch.value = isMetaSearch;
:
:
: RefreshPageParams.submit();
:
: Regarding the receiving page, here is the code that receives the string
: that unfortuatley contains a carriage return:
: SearchXML = Request("SearchXML")

You using XML but your pages are not well formed.
Have you tested the length of the value before and after posting?
Shouldn't you be using:
SearchXML = Request.Form("SearchXML")

What language is your RefreshPageParams written in?
Do you zero out variables before [re]use?

What is the value of:
sTheSearchXML
before it is added to:
RefreshPageParams.SearchXML.value

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top