Jump to content

[SOLVED] Setting condidtions for an input box


uwictech

Recommended Posts

I would say that you have 3 choices:

1. - Use javascript to control the format and data type (ie numeric only)

2.  - Alternatively you could provide 4 text boxes and set the maxlength on each one accordingly then, when the form is posted, join them up with php.  However, you would still need some javascript if you want to only allow them to input numbers.

3. - Finally this could be checked and controlled by php when the form is posted.  However, this means that you will have to show the form again if the number is incorrect and prefill all the fields with the data that the user has introduced.

 

Chris

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.