SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Smart Substring

  1. #1
    SitePoint Enthusiast alsaffar's Avatar
    Join Date
    Aug 2002
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smart Substring

    Hi everybody,

    I have a unrgent question because my boss is awaiting me to fix it

    If I have the following variable which contains the drop down menu for list of card numebrs:

    var abc='<option value="1234567890123456">1234567890123456</option><option value="0987654321987654">0987654321987654</option><option value="0147852369014785">0147852369014785</option>';

    How can I pass this variable to a function and mask only the dispalyed card number? i.e. to have the following result:

    <option value="1234567890123456">1234XXXXXXXX3456</option><option value="0987654321987654">0987XXXXXXXX7654</option><option value="0147852369014785">0147XXXXXXXX4785</option>

    Note: the number of options in the drop down menu may varry, in this example its only 3 options, it might be more or less, this is why I called it "Smart Substring"

    Please your fastest response is highly apreciated

    Thanks in advance
    HaVe a GooD DaY

    @li @l$@ff@R

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why do you want to use JavaScript to do that?

    Why do you want to do this at all anyway? The only tiny help to security is if someone was lookin' over the shoulder of someone using that page. It would not protect them from being intercepted during the transfers over the Internet.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


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
  •