Re: Moving a string from VBScript to JScript
From: Viatcheslav V. Vassiliev (msnewsgroup_at_www-sharp.com)
Date: 06/18/04
- Next message: Viatcheslav V. Vassiliev: "Re: Error Message (0x800401F3)"
- Previous message: Viatcheslav V. Vassiliev: "Re: display bytes (again)"
- In reply to: Roger Withnell: "Re: Moving a string from VBScript to JScript"
- Next in thread: Martin Honnen: "Re: Moving a string from VBScript to JScript"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 18 Jun 2004 13:08:59 +0400
If I am not wrong, Martin suggested replace carriage returns with \n (escape
sequence for carriage return). If your script is in JScript, now you have
(after executing ASP):
document.Form1.Text.value = 'some text
that continues on next line';
You should have (next line has no breaks):
document.Form1.Text.value = 'some text\nthat continues on next line';
//------------------------------------
Regards,
Vassiliev V. V.
http://www-sharp.com -
Scripting/HTA/.Net Framework IDE
"Roger Withnell" <rogerREMOVE@THISFIRSTupperbridge.co.uk> сообщил/сообщила в
новостях следующее: news:caq9td$mka$1@titan.btinternet.com...
> Thanks for all the help.
>
> I tried using the hidden <div>, Viatcheslav, which avoided the error, but
> the conversion lost the carrier return.
>
> I didn't understand Martin's answer. If I had, it looked like the simplest
> solution.
>
> I fixed it by using RegExp in VBScript to change the carrier return to a
> string of characters (I used "zYz") and then used RegExp in JScript to
> convert "zYx" back to a carrier return. Cumbersome, but it works.
>
> Martin, if you see this, please help me with your solution. Clearly more
> efficient.
>
>
> "Viatcheslav V. Vassiliev" <msnewsgroup@www-sharp.com> wrote in message
> news:usyCNUsUEHA.3944@TK2MSFTNGP12.phx.gbl...
> > Could you place <%= SurveyUpdateRS("IntraText") %> into HTML code, not
> > script, such as
> >
> > <FORM action="..." method="POST">
> > <% Response.Write(SurveyUpdateRS("IntraText")) %>
> > </FORM>
> >
> > Or place it into hidden DIV and then use myDiv.innerText (or innerHTML).
> >
> > //------------------------------------
> > Regards,
> > Vassiliev V. V.
> > http://www-sharp.com -
> > Scripting/HTA/.Net Framework IDE
> >
> > "Roger Withnell" <rogerREMOVE@THISFIRSTupperbridge.co.uk>
сообщил/сообщила
> в
> > новостях следующее: news:camg9u$2bf$1@titan.btinternet.com...
> > > But I'm using the carrier return to format the text when it is
> displayed.
> > >
> > > Any other thoughts? Or should I substitute the carrier return with
> > > something else with which to format the text?
> > >
> > >
> > > "MikeB" <m.byerleyATVerizontDOTnet> wrote in message
> > > news:OLss04mUEHA.3420@TK2MSFTNGP12.phx.gbl...
> > > >
> > > > "Roger Withnell" <rogerREMOVE@THISFIRSTupperbridge.co.uk> wrote in
> > message
> > > > news:calbva$8e5$1@titan.btinternet.com...
> > > > > I'm using:
> > > > >
> > > > > document.Form1.Text.value = '<%= SurveyUpdateRS("IntraText") %>';
> > > >
> > > > I ran into this a couple of years ago. In my case the solution was
to
> > > strop any
> > > > CR from the text before saving to the DB as part of the validation
> > before
> > > > submit.
> > > >
> > > > > to set a form value from a recordset.
> > > > >
> > > > > This works fine unless "IntraText" includes a carrier return.
Then
> > the
> > > > > whole jscript routine fails.
> > > > >
> > > > > Please advise.
> > > > >
> > > > > Thanking you in anticipation.
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
- Next message: Viatcheslav V. Vassiliev: "Re: Error Message (0x800401F3)"
- Previous message: Viatcheslav V. Vassiliev: "Re: display bytes (again)"
- In reply to: Roger Withnell: "Re: Moving a string from VBScript to JScript"
- Next in thread: Martin Honnen: "Re: Moving a string from VBScript to JScript"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|