7 Replies - 2791 Views - Last Post: 10 February 2009 - 11:42 PM Rate Topic: -----

#1 AXRabbit  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 04-February 09

How to Validate Creditcard number in Textbox

Post icon  Posted 10 February 2009 - 05:59 AM

Hi,
I have created a Textbox for my credit card number entry for my payment webpage. Can anyone help me in telling me the codes of how to make sure 16 digits of the number is entered . Methods such as count or something which i completely forgot?!

Thank you so much.Any advise is appreciated deeply.
Is This A Good Question/Topic? 0
  • +

Replies To: How to Validate Creditcard number in Textbox

#2 Nikhil_07n  Icon User is offline

  • The cheese stands alone..
  • member icon

Reputation: 49
  • View blog
  • Posts: 2,489
  • Joined: 09-January 09

Re: How to Validate Creditcard number in Textbox

Posted 10 February 2009 - 06:54 AM

Private sub Text1_LostFocus()

If Len(Text1.Text) <> 16 then
Msgbox "Ent. 16 Digit number"
End If

End Sub



Simple.

Say Thanks.
Was This Post Helpful? 0
  • +
  • -

#3 AXRabbit  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 04-February 09

Re: How to Validate Creditcard number in Textbox

Posted 10 February 2009 - 07:39 AM

Wow~ very useful. Thank you so much ~ ^_^
Was This Post Helpful? 0
  • +
  • -

#4 bejosano_mara  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 17-March 08

Re: How to Validate Creditcard number in Textbox

Posted 10 February 2009 - 10:31 AM

View PostAXRabbit, on 10 Feb, 2009 - 04:59 AM, said:

Hi,
I have created a Textbox for my credit card number entry for my payment webpage. Can anyone help me in telling me the codes of how to make sure 16 digits of the number is entered . Methods such as count or something which i completely forgot?!

Thank you so much.Any advise is appreciated deeply.



you can also try...

Textbox properties
MaxLength=16

mara
Was This Post Helpful? 0
  • +
  • -

#5 AXRabbit  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 04-February 09

Re: How to Validate Creditcard number in Textbox

Posted 10 February 2009 - 09:46 PM

Oh thank you Mara.~^_^I will try that out too!

Hey by the way i just noticed i miss out something on the my starting post:


Becoz is meant to be a creditcard number input textbox , How to ensure/enforce the text input in the textbox is a numeric integer. No characters is allowed.


Any advise to this newbie is deeply appreciated. Thank you so much for the effort and time for reading this post.

This post has been edited by AXRabbit: 10 February 2009 - 09:48 PM

Was This Post Helpful? 0
  • +
  • -

#6 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1637
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How to Validate Creditcard number in Textbox

Posted 10 February 2009 - 10:22 PM

For that you would use the IsNumeric Function

P.S: I know the link is for .Net but IsNumeric works the same for VB6 as it does VB.NET :)
Was This Post Helpful? 0
  • +
  • -

#7 AXRabbit  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 04-February 09

Re: How to Validate Creditcard number in Textbox

Posted 10 February 2009 - 11:11 PM

Many thanks~PyschoCoder.

I saw the link , and i realised it includes even a decimal. Which means under the condition of my creditcard number textbox, it would accept a decimal point.
Was This Post Helpful? 0
  • +
  • -

#8 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1637
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How to Validate Creditcard number in Textbox

Posted 10 February 2009 - 11:42 PM

No problem, glad I could help :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1