Hello,
I have a simple problem which I am guessing has an easy answer within
JavaScript.
I have a form1 with two fields, field1 and field2. I want the contents of
field1 to be transferred to field2 onBlur, but with some changes.
I want the contents of field1 to have its spaces replaced with Dashes, and
all punctuation removed, so this can happen:
FIELD 1 value:
Today's rate is 15%, & the outlook is good.
onBlur should then create a value of:
FIELD 2 value:
todays-rate-is-15-percent-and-the-outlook-is-good
Notice that the "&" was converted to "and", the "%" to "percent". The comma
was deleted and all spaces replaced with Dashes. The second field should
only every contain alphabetic letter, dashes, and numbers.
Any ideas guys?
Cheers,
Jim.
I have a simple problem which I am guessing has an easy answer within
JavaScript.
I have a form1 with two fields, field1 and field2. I want the contents of
field1 to be transferred to field2 onBlur, but with some changes.
I want the contents of field1 to have its spaces replaced with Dashes, and
all punctuation removed, so this can happen:
FIELD 1 value:
Today's rate is 15%, & the outlook is good.
onBlur should then create a value of:
FIELD 2 value:
todays-rate-is-15-percent-and-the-outlook-is-good
Notice that the "&" was converted to "and", the "%" to "percent". The comma
was deleted and all spaces replaced with Dashes. The second field should
only every contain alphabetic letter, dashes, and numbers.
Any ideas guys?
Cheers,
Jim.
Comment