[Javascript] chopping up a string?

Walter Torres walter at torres.ws
Mon Nov 17 09:03:51 CST 2003


Do you want this...
 - on the fly (as they type)
 - after the field losses focus
 - modify the data just before the form is submitted

Questions, questions.

I have code for the last, still fiddling with code for the first.

Walter



> -----Original Message-----
> From: javascript-bounces at LaTech.edu
> [mailto:javascript-bounces at LaTech.edu]On Behalf Of Paul McGuire
> Sent: Monday, November 17, 2003 4:06 AM
> To: [JavaScript List]
> Subject: [Javascript] chopping up a string?
> 
> 
> Hi Guys n gals,
> 
> I need to be able to break up a numeric form field in JS and turn 
> it into a
> date format for example:
> 
> someone enters 10 into the text box, the JavaScript needs to change it to
> 10/10/03 (or whatever the current date is!)
> 
> likewise if they enter 1010 the JS should change it to 10/10/03 etc.
> 
> I am familiar with capyuring the data and passing it to a 
> function and then
> passing it back to the text field. However counting andchopping up the
> string is something  I cant do. if 1010 is entered I need to know how to
> count there are 4 numbers split them into10/10 and grab the 
> current year and
> add /03 to the end.
> 
> Any Help would be apreciated.
> 
> Paul
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list