GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Ja\/askript help (https://gfy.com/showthread.php?t=197597)

Dildozer 11-14-2003 08:50 PM

Ja\/askript help
 
ok i have this problem

in my form i have a field for credit cards

so i call that value like
form1.number.value

now the value can be numbers separated by spaces like 5555 5555 5555 5555 or all together like 5555555555555555

What i want to do is a function to check if there are spaces and remove them and give me the real value

for example the surfer puts in his cc# like this: 5258 5599 5599 5599, i want when he submits it to turn into 5258559955995599

i tried this but i get an undefined value in the end

var j= form1.number.value;
var k;
for (i=0, i=j.lenght; i++){
if (j.sub5tring(i,i+1)=' ') {
k = k+'';
k = k+j.sub5tring(i,i+1);}}
form1.number.value = k;

can anyone help me?

gornyhuy 11-14-2003 08:56 PM

The board fucked your code all up....

i suggest you go to j a va sc ri ptsource.com and search there for prebuilt examples, or go here:

http://www.vtfb.org/vfbmember/overview.htm

and click on the FormChek.js and in that code search for stripwhitespace. Lots of good examples in there.

Dildozer 11-14-2003 09:09 PM

thanks


All times are GMT -7. The time now is 12:45 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123