Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - How to display xxx-xxx-xxxx-1234
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to display xxx-xxx-xxxx-1234

 Post Reply Post Reply
Author
rocketdawg View Drop Down
Newbie
Newbie
Avatar

Joined: 03 August 2004
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote rocketdawg Quote  Post ReplyReply Direct Link To This Post Topic: How to display xxx-xxx-xxxx-1234
    Posted: 06 April 2005 at 10:13pm
Instead of the whole credit card #?
 
If anyone knows how to format the display, I would surely appreciate it.
 
asp classic please.
 
Thank you anyone.
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 07 April 2005 at 1:10am
probably something along the lines of a trim function... i'll have a look around for you...
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 07 April 2005 at 1:25am
dim number, trimmed
number=request.form("CCard")
trimmed=Right(number,4)
response.write "XXXX-XXXX-XXXX-" & trimmed
i think that is the right syntax.
anyway, below is a working eg.
dim txt
txt="This is a beautiful day!"
document.write(Right(txt,11))
Output:
utiful day!
Back to Top
rocketdawg View Drop Down
Newbie
Newbie
Avatar

Joined: 03 August 2004
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote rocketdawg Quote  Post ReplyReply Direct Link To This Post Posted: 07 April 2005 at 12:44pm
Superb !
 
Thank you very much !
 
This forum is great. Every time I get stumped and ask a question (all 4 of them), it is answered inside of a day. I would like to thank everyone that answers questions for their community spirit in helping others.
 
Have a great day !!
 
rd
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2005 at 6:24am
but remember some credit cards have different ammount of numbers


i have done a script that

CardShort = len(cardNumber) - 4

for looper = 1 to ubound(CardShort)

strCardNumberTemp = strCardNumberTemp & "*"

next

cardNumber = strCardNumberShort & Right(cardNumber,4)

thinking oif you want the - also .. you would have to do a diffferent sligfhtly checking what the value is if its a number or not and if not add a - else *
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.