Hi,
I have a form where users puts dimensions of a banner.
Dimensions are width and heigth.
These dimensions can be also decimal like "12.4".
My users are italian and they use COMMA and non DOT so if they put "12,4" javascript validation number system makes an error.
So I whould replace COMMA with DOT automatically.
Here a piece of my form:
I have found online this solution:
and I have modified my code like here:
but doesn't update every time my input box, some times yes and sometimes no.
Why?
You can see my form here:
http://www.sgagrafica.com/index.php?option=com_content&view=article&id=77&Itemid=120
Regards
monak83
I have a form where users puts dimensions of a banner.
Dimensions are width and heigth.
These dimensions can be also decimal like "12.4".
My users are italian and they use COMMA and non DOT so if they put "12,4" javascript validation number system makes an error.
So I whould replace COMMA with DOT automatically.
Here a piece of my form:
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 440px;">Base (in cm)</label>
<input class="cf_inputbox required validate-number" maxlength="150" size="5" id="text_2" name="base" type="text" onChange="updatethis(this.form);" value="" />
I have found online this solution:
onchange="this.value=this.value.replace(/\,/,'.');"
and I have modified my code like here:
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 440px;">Base (in cm)</label>
<input class="cf_inputbox required validate-number" maxlength="150" size="5" id="text_2" name="base" type="text" onChange="updatethis(this.form); this.value=this.value.replace(/\,/,'.');" value="" />
but doesn't update every time my input box, some times yes and sometimes no.
Why?
You can see my form here:
http://www.sgagrafica.com/index.php?option=com_content&view=article&id=77&Itemid=120
Regards
monak83