Replace commas in values in an array

Discussion in 'Javascript' started by Adrienne Boswell, Apr 5, 2007.

  1. Although this is a client side issue, I am also posting to asp.general
    in case there is someway to do this only server side (which I would
    prefer).

    Here's my form:

    <form method="post" action="<%=request.servervariables("Script_name")
    %>"
    <% for i - 0 to 4%>
    Header: <input type="text" name="header" id="header<%=i%>"
    onblur="function(this)"><br>
    Description: <input type="text" name="description" id="description<%=i
    %>" onblur="function(this)">
    <% next%>
    <input type="submit" value="Submit">
    </form>

    When the data gets returned it's something like:
    header: "socks, shoes, pizza, cats, dogs"
    description: "good for feet, wear with socks, cheese only, have lots
    of hair, bark a lot"

    Problem comes when the description or header have a comma. I need a
    little javascript that will replace the comma with a semicolon client
    side before it gets to
    the server, preferably as they leave the field.

    Any help with this would be much appreciated.

    --
    Adrienne Boswell at work
    Administrator nextBlock.com
    http://atlas.nextblock.com/files/
    Please respond to the group so others can share
     
    Adrienne Boswell, Apr 5, 2007
    #1
    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. AviraM
    Replies:
    2
    Views:
    6,509
    Manish Pandit
    Sep 28, 2006
  2. Adrienne Boswell

    Replace commas in values in an array

    Adrienne Boswell, Apr 5, 2007, in forum: ASP General
    Replies:
    12
    Views:
    520
  3. John Griffiths

    replace spaces with commas?

    John Griffiths, Nov 3, 2008, in forum: Ruby
    Replies:
    7
    Views:
    171
    Pablo Q.
    Nov 5, 2008
  4. Allan
    Replies:
    5
    Views:
    213
    Allan
    Mar 3, 2010
  5. Chuck Brotman

    Idiomatic Printing an array with commas

    Chuck Brotman, Jun 13, 2010, in forum: Ruby
    Replies:
    6
    Views:
    117
    Chuck Brotman
    Jun 18, 2010
Loading...

Share This Page