Page 1 of 1

Alter Length of textbox ?

Posted: Wed Mar 11, 2009 11:08 am
by J#xx
Hi, i'm a little bit stuck with this one. I need to reduce the length of a text box from 15 to 6, I tried various things i've found on google about the subject but nothing works. here's the code....

Code: Select all

<?php echo zen_draw_input_field('lsphere', $account->fields['customer_lsphere'], 'id="lsphere"') . (zen_not_null(ENTRY_LSPHERE_NUMBER_TEXT) ? '<span class="alert">' . ENTRY_LSPHERE_NUMBER_TEXT . '</span>': ''); ?></span></td>
The database for this field is set to 6 but the box allows up to around 15, is it possible to change the amount of digits in the box ?

Cheers
J#xx

Re: Alter Length of textbox ?

Posted: Wed Mar 11, 2009 12:16 pm
by jayshields
I don't know how your function works, but you need a maxlength attribute in your input tag. Maybe change 'id="lsphere"' to 'id="lsphere" maxlength="6"'?

You should not rely on this method for data validation though, you should also check the length on the server-side.