[Zope] Textareas and SQL (Gadfly)
Evan Gibson
egibson@connect.com.au
Wed, 9 Feb 2000 02:53:49 +1100
I've been hitting my head on the wall for hours over this...
I've got a large collection of forms feeding into a gadfly
database without a problem, and then a few that don't work
at all.
The only difference I can see is that the ones that fail have
<textarea> data and the ones that work don't.
I'm getting a:
Error Type: LexTokenError
Error Value: Lexical token not found near ::
"s of Bloodax',\012"*"'A determined c"
What I _think_ is happening is that gadfly can't handle carriage
returns and line feeds in the string input. (Which is why I
was trying things like "virtual" to perhaps get rid of them.)
Hmmm... Actually, just tried something else, the below versions
actually work, but _only_ if you delete all linefeeds from the
textarea and let it wrap all by it's lonesome... Something I
can't guarantee my users will do.
Is there a way I can remove the carriage returns prior to
hitting the sql? I was hoping to use some kind of formatting
command rather than trying some weird kind of _.string.sub
call.
Thanks.
Evan Gibson
(below is the demo info)
The form has fields:
Name: <input type="text" name="name:string" size="40" value=""><br>
Description: <textarea name="description:text" wrap="virtual" cols="50"
rows="5"></textarea><br>
(I've tried description with wrap=On/Off/Virtual and with and without
the :text typecasting.)
Sql is called by:
<dtml-call "item_create(item_name=name,description=description)">
Sql query has:
Arguments- description:string name:string
insert into item_table
(name, description)
values
(<dtml-sqlvar item_name type=string>,
<dtml-sqlvar description type=string optional>)
--
Evan ~ThunderFoot~ Gibson ~ nihil mutatem, omni deletum ~
May the machines watch over you with loving grace.