SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    May 2001
    Location
    UK
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Form Manipulation

    OK. I am attempting to pass two user inputs into one variable (text, not array) to pass through my credit card company.

    What I have done it two "onchange" scripts so that when the customer enters their information the script runs it does a search and replace on "name" for there name and "number" for their number. However!! If they change their name (or number) a second time the search and replace will fail as it will no longer find "name". Therefore I though some sort of RegX facilitated where I prefix their name with a hypen i.e. '-'.

    Is it possible to use regX in this way in Javascript? Can anyone provide advise or a link?
    Alternatively, am I making this a lot harder than it needs to be!? i.e. could I do an onSubmit instead to change it? I have tried this, however it didn't seem to work.

    Thanks

  2. #2
    SitePoint Zealot romance's Avatar
    Join Date
    Apr 2004
    Location
    UK
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    could you not do the search and replace function on the onsubmit action of the form? That way they can change it allthey like and it only works once they are ready to submit? Might of got the wrong end of the stick tho..


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •