copy and paste form RTF document into field in asp form cause it to bypass field length and javascri

Discussion in 'Javascript' started by NotGiven, May 12, 2004.

  1. NotGiven

    NotGiven Guest

    I have a web form with several fields. If I copy & paste from a RTF
    document into a field, the javascript validation and field length are
    bypassed and cause the form to fail.

    Any ideas?
    NotGiven, May 12, 2004
    #1
    1. Advertising

  2. NotGiven

    kaeli Guest

    In article <m1toc.2789$>,
    enlightened us with...
    > I have a web form with several fields. If I copy & paste from a RTF
    > document into a field, the javascript validation and field length are
    > bypassed and cause the form to fail.
    >
    > Any ideas?


    Code better?

    (I have no clue. I've never heard of such a thing. Post code so we can
    see what's going on along with a working example if possible.)

    --
    --
    ~kaeli~
    A midget fortune teller who escapes from prison is a small
    medium at large.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, May 12, 2004
    #2
    1. Advertising

  3. Is this really an ASP question that involves databases???

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "NotGiven" <> wrote in message
    news:m1toc.2789$...
    > I have a web form with several fields. If I copy & paste from a RTF
    > document into a field, the javascript validation and field length are
    > bypassed and cause the form to fail.
    >
    > Any ideas?
    >
    >
    Aaron Bertrand - MVP, May 12, 2004
    #3
  4. Re: copy and paste form RTF document into field in asp form causeit to bypass field length and javascript validation - how to overcome?

    NotGiven wrote:
    > I have a web form with several fields. If I copy & paste from a RTF
    > document into a field, the javascript validation and field length are
    > bypassed and cause the form to fail.
    >
    > Any ideas?
    >
    >

    Possibly you should HTMLEncode the field value(s)?

    i.e., when a field is first input:
    strField = Server.HTMLEncode( Request.Form( RTFfield ) )

    Or you could HTMLEncode it immediately prior to output, e.g.,
    <input type="text" name="myname"
    value= "<% =Server.HTMLEncode( rs("myField1") ) %>"
    or in a table,
    <td><% =Server.HTMLEncode( rs("MyField2") ) %></td>

    Reason I raise this is that, if you are not using HTMLEncode, then
    perhaps control characters in the RTF text are interfering with the HTML
    display.

    Good Luck,
    Michael D. Kersey
    Michael D. Kersey, May 13, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kleuskes & Moos
    Replies:
    8
    Views:
    553
  2. Dr. X
    Replies:
    1
    Views:
    441
    Saravana
    Jul 22, 2003
  3. NotGiven
    Replies:
    3
    Views:
    331
    Michael D. Kersey
    May 13, 2004
  4. Tony
    Replies:
    2
    Views:
    273
  5. Replies:
    6
    Views:
    612
    Nigel Wade
    Sep 3, 2012
Loading...

Share This Page