Home > Archive > ASP > March 2008 > Input lost
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| The situation :
an ASP VBscript application on IIS 6 with (ado) connection to a
database.
When I had a record with text via an input object on a ASP page
everything is OK and I see the new record (text) on an other page with
a grid. The text is correctly stored in the database.
Now the problem : If I use the sign > " < in a text (in a input
object) and store it in the database It is also OK ..
(it appair normaly on the page with a grid). It is also correctly
stored in the database.
But when I try to load this string again in a input object (to maken
change) al the sign's after the " are disappeared. I just cann't find
out why ?!
All others sign's and letter's don't disappear..
Any help is welcome..
--
Regards,
Georges
| |
| Evertjan. 2008-03-01, 6:56 pm |
| Geo55 wrote on 01 mrt 2008 in microsoft.public.inetserver.asp.general:
> The situation :
> an ASP VBscript application on IIS 6 with (ado) connection to a
> database.
>
> When I had a record with text via an input object on a ASP page
> everything is OK and I see the new record (text) on an other page with
> a grid. The text is correctly stored in the database.
>
> Now the problem : If I use the sign > " < in a text (in a input
> object) and store it in the database It is also OK ..
> (it appair normaly on the page with a grid). It is also correctly
> stored in the database.
>
> But when I try to load this string again in a input object (to maken
> change) al the sign's after the " are disappeared. I just cann't find
> out why ?!
>
> All others sign's and letter's don't disappear..
> Any help is welcome..
Your sql string seems to end prematurely on a " in a string.
The quality of your code seems not the be adaequate.
However, without you showing any code, it is immpossible to say for sure.
Please show only the relevanrt code.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
| |
|
| Op 01 Mar 2008 21:14:26 GMT, schreef "Evertjan."
<exjxw.hannivoort@interxnl.net> :
>Geo55 wrote on 01 mrt 2008 in microsoft.public.inetserver.asp.general:
>
>
>Your sql string seems to end prematurely on a " in a string.
>The quality of your code seems not the be adaequate.
>However, without you showing any code, it is immpossible to say for sure.
>
>Please show only the relevanrt code.
Wel I don't think so. The SQL string is :
set rsEdit = conn.Execute("SELECT * FROM taken WHERE id=" &
lngRecordNo)
If I put this <% = rsEdit("Taak") %> outside the input object
anywhere on the page everything from the field "Taak" appair (also
the " and what follow )
The " and all what follow it only disappear within a input object like
: <input name="Taak" type="text" value="<% = rsEdit("Taak") %>
" size="100" maxlength="100">
--
Regards,
Georges
| |
| Evertjan. 2008-03-01, 6:56 pm |
| Geo55 wrote on 02 mrt 2008 in microsoft.public.inetserver.asp.general:
> The " and all what follow it only disappear within a input object like
>: <input name="Taak" type="text" value="<% = rsEdit("Taak") %>
> " size="100" maxlength="100">
>
value = "<% = rsEdit("Taak") %>"
Always look at the view source!
ASP does not reach the client browser.
if the string put in the html stream
sent to the client by <% = rsEdit("Taak")%>
contains a " the view sours will show:
value = "Georges zei: "Goede morgen""
value would only get the string
contained within the first two "":
value = "Georges zei: "
Duidelijk?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
| |
|
| Op 01 Mar 2008 23:25:17 GMT, schreef "Evertjan."
<exjxw.hannivoort@interxnl.net> :
>Geo55 wrote on 02 mrt 2008 in microsoft.public.inetserver.asp.general:
>
>
>value = "<% = rsEdit("Taak") %>"
>
>Always look at the view source!
>ASP does not reach the client browser.
>
>if the string put in the html stream
>sent to the client by <% = rsEdit("Taak")%>
>contains a " the view sours will show:
>
>value = "Georges zei: "Goede morgen""
>
>value would only get the string
>contained within the first two "":
>
>value = "Georges zei: "
>
>Duidelijk?
Bedankt voor je reactie. Daar had ik echt niet aan gedacht.
Is er geen work around ?
--
Regards,
Georges
| |
| Dave Anderson 2008-03-02, 6:56 pm |
| "Geo55" wrote:
> Now the problem : If I use the sign > " < in a text (in a input
> object) and store it in the database It is also OK ..
> (it appair normaly on the page with a grid). It is also correctly
> stored in the database.
>
> But when I try to load this string again in a input object (to maken
> change) al the sign's after the " are disappeared. I just cann't find
> out why ?!
<input value="Server.HTMLEncode({your value})" ...>
http://msdn2.microsoft.com/en-us/library/ms525347.aspx
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
| |
|
| Op Sun, 2 Mar 2008 11:32:47 -0600, schreef "Dave Anderson"
<NPQRWPDWZGSP@spammotel.com> :
>"Geo55" wrote:
>
> <input value="Server.HTMLEncode({your value})" ...>
>
>http://msdn2.microsoft.com/en-us/library/ms525347.aspx
Many thanks ! Great ! everything is working nice.
I have learned something interesting to day.
--
Regards,
Georges
| |
| Evertjan. 2008-03-02, 6:56 pm |
| Geo55 wrote on 02 mrt 2008 in microsoft.public.inetserver.asp.general:
> Op 01 Mar 2008 23:25:17 GMT, schreef "Evertjan."
> <exjxw.hannivoort@interxnl.net> :
>
like[color=darkred]
>
> Bedankt voor je reactie. Daar had ik echt niet aan gedacht.
> Is er geen work around ?
Natuurlijk, als je ASP-vbs gebruikt:
value = "<% = replace(rsEdit("Taak"),"""","""""") %>"
die escape-t iedere " in de string naar ""
Maar er kan in de string ook een return zitten, die in html verkeerd
wordt gelezen, en dat zou je ook moeten "valideren".
Test dus alle mogelijkheden door steeds de view-source te bekijken.
==============
voor ASP-jscript:
value = "<% = rsEdit("Taak").replace(/"/g,'\\"') %>"
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
| |
|
| Op 02 Mar 2008 22:31:19 GMT, schreef "Evertjan."
<exjxw.hannivoort@interxnl.net> :
>
>Natuurlijk, als je ASP-vbs gebruikt:
>
>value = "<% = replace(rsEdit("Taak"),"""","""""") %>"
>
>die escape-t iedere " in de string naar ""
>
>Maar er kan in de string ook een return zitten, die in html verkeerd
>wordt gelezen, en dat zou je ook moeten "valideren".
>
>Test dus alle mogelijkheden door steeds de view-source te bekijken.
>
>==============
>
>voor ASP-jscript:
>
>value = "<% = rsEdit("Taak").replace(/"/g,'\\"') %>"
Bedankt voor het antwoord maar iemang gaf me hier een mooie oplossing
namelijk : value= "<% = Server.HTMLEncode(rsEdit("Taak"))%>"
Heb het uitgetest en geen last meer met speciale tekens !
--
Regards,
Georges
|
|
|
|
|