2

I'm developing a component in which I'm taking the value from a user in the backend using an edit form, but when I type my 10 digit mobile number in the field, it automatically converts it into different a digit.

How can I solve this?

Can anyone see what I'm doing wrong in my code:

Tel Field In XML File:

<field 
    name="tel" 
    type="text" 
    class="inputbox"
    label="COM_STUDENT_FORM_LBL_STUDENT_TEL"
    description="COM_STUDENT_FORM_DESC_STUDENT_TEL"
    required="true" 
/>

Tel field in edit.php (layout file)

<div class="control-group">
    <div class="control-label"><?php echo $this->form->getLabel('tel'); ?></div>
    <div class="controls"><?php echo $this->form->getInput('tel'); ?></div>
</div>

The bind function in the table does not contain the tel field for further processing in the Database.

The table Field have given property

Name=tel
type=int(11)
default= none 
3

There's nothing wrong in your code, rather your table definition.

Max range of INT in MySQL is:

-2147483648 to 2147483647

So instead of using INT for your table field, use BIGINT

More details about integer data types can be found here: https://dev.mysql.com/doc/refman/5.1/en/integer-types.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.