Skip to main content
Participant
November 30, 2006
Question

how to strip extra spaces

  • November 30, 2006
  • 1 reply
  • 421 views
I have a cfinput bound to a cfgrid based on a DB query. The zip field in the DB has a length of 20 chars. When the zip binds to my cfinput it pulls the data, including the extra spaces after it, for instance "02134 ". My cfinput zip field validates for ZIP, so the validation fails because of the extra spaces. Is there a way to strip these??

Thanks. --Steve
    This topic has been closed for replies.

    1 reply

    Inspiring
    November 30, 2006
    Depending on what DB you are using trim the space in your query.

    Select rtrim(zipcodes) as zipcodes

    "sbrehm" <webforumsuser@macromedia.com> wrote in message
    news:eknci3$jdp$1@forums.macromedia.com...
    >I have a cfinput bound to a cfgrid based on a DB query. The zip field in
    >the DB
    > has a length of 20 chars. When the zip binds to my cfinput it pulls the
    > data,
    > including the extra spaces after it, for instance "02134 ".
    > My
    > cfinput zip field validates for ZIP, so the validation fails because of
    > the
    > extra spaces. Is there a way to strip these??
    >
    > Thanks. --Steve
    >


    sbrehmAuthor
    Participant
    November 30, 2006
    Yes, of course... Thanks!