Forums

This topic is locked

Format text from form field to database

Posted 05 Oct 2001 17:27:55
1
has voted
05 Oct 2001 17:27:55 Jeff Hansen posted:
I need to figure out how to have my form capture the page breaks that are used when users are writing paragraphs in a FORM. Right now, everything that it entered is just one long paragraph, the <BR> are not captured and sent as part of the text to the database.

Some please let me know how to handle this problem!

Thanks,
Jeff


Replies

Replied 05 Oct 2001 18:03:57
05 Oct 2001 18:03:57 Owen Eastwick replied:
Enter the text in a multi line text field and insert it into a memo field in the database.

When you want to display it, complete with line breaks.

Replace this:

<%= (YourRecordsetName.Fields.Item("FieldName".Value)%>

With this:

<%= Replace(YourRecordsetName.Fields.Item("FieldName".Value,VbCrLf,"<br>"%>

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo

Edited by - oeastwick on 10/05/2001 18:05:05
Replied 05 Oct 2001 18:09:35
05 Oct 2001 18:09:35 Ryan Grace replied:
Can this also be done in Java? Looks like the code you provided was for ASP.

Thanks,

Ryan

Replied 05 Oct 2001 18:53:53
05 Oct 2001 18:53:53 Owen Eastwick replied:
Provided there is an equivalent Java function for <b>Replace</b> then it shouldn't be a problem but I don't know the syntax.

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 04 Apr 2008 21:57:15
04 Apr 2008 21:57:15 Shawn Stark replied:
I am attempting to do the same thing with JSP..
When using

&lt;%= Replace(YourRecordsetName.Fields.Item("FieldName".Value,VbCrLf,"&lt;br&gt;"%&gt;

Dose this place a break after VbCrLf or where every break is supposed to be created based on the data entered in the form.

I will not be updating my DB via a result set. I will be useing prepared statements and my own dynamic array class for retaining data for display...

I need to find a solution for my TEXT field or VARCHAR field that holds multi-line text data. As far as I know you can only save a String of characters in this field and saving stuff like
&lt;font color="red"&gt;somedata&lt;/font&gt; will cause issues becuz of the "" QUOTES is there an excape key to use when inserting or updating DB

INSERT INTO
frackinTabl (myField) VALUES ('&lt;font color="red"&gt;somedata&lt;/font&gt;&lt;br/&gt;')
<font color=red>Notice ^ that QUOTES & TICKS r different</font id=red>

How do I extract line number from multi line form data... Is this data just a single string or are there delimiters... I am sure I can create a solution wrapping the text in the display. This dose not allow my users much Formating control..


Reply to this topic