Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbcrlf?

Status
Not open for further replies.

bigairguy

Programmer
May 10, 2005
14
US
I've done some research and can't seem to figure this out. I have a webform in which I am passing data through a querystring to a pop-up window. However, one of the controls on my form is a multi-line textarea. I need to pass the contents of the textarea into the querystring when the contents are on several lines. I know that I need to use the vbcrlf function and do something like Replace("vbcrlf", "<br>) and I know in general what it does, but I'm stuck on how to go about implementing this. Could someone give me some pointers that will get me going in the right direction?

Here is my textarea contol and link to the popup window:

<textarea name="instructions" style="WIDTH: 100%; HEIGHT: 115px" tabindex="39" disabled rows="1" cols="20"><%Response.Write rsSelectGroup("INSTRUCTIONS")%>
</textarea>


<center><a href="JavaScript://" onclick="win1=openNewWindow('PrintTransaction.asp?TransactionID=<%=TransacID%>&Instructions=<%=Instructions%>', 'saPrint', 600, 400, 'scrollbars,location,status,menubar,toolbar,resizable,status')">Printer-friendly version</a></center>


Any help to get me going in the right direction would be extremely appreciated.

Thanks in advance,
Patrick
 
bigairguy,

[1] What is openNewWindow? I would guess it is a dressed up window.open?
[2] What is server-side variable Instructions? Is it the same as rsSelectGroup("INSTRUCTIONS") ???
[3] Is it that Instructions (probably equal to rsSelectGroup() as mentioned in [2]) contains formatting vbcrlf or alike?

Based on some assumptions, I would guess you can do something like this. (I use uniformly <%=xxx%> type construction, nothing wrong with your construction.)
[tt]
<%
s=rsSelectGroup("INSTRUCTIONS")
t=replace(s,vbcrlf,"<br />"
'further replace just for some other common possibilities
'but must be done after replacing vbcrlf
t=replace(t,vbcr,"<br />")
t=replace(t,vblf,"<br />")
%>
[/tt]
Then writing out the document like this.
[tt]
<textarea name="instructions" style="WIDTH: 100%; HEIGHT: 115px" tabindex="39" disabled rows="1" cols="20"><%=[blue]s[/blue]%>
</textarea>

<center><a href="JavaScript://" onclick="win1=openNewWindow('PrintTransaction.asp?TransactionID=<%=TransacID%>&Instructions=<%=[red]t[/red]%>', 'saPrint', 600, 400, 'scrollbars,location,status,menubar,toolbar,resizable,status')">Printer-friendly version</a></center>
[/tt]
regards - tsuji
 
There is a limit to how much text you can push through the querystring.

If you find yourself with very long text you might have to switch to HTML forms with method="POST
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top