Jump to content

max value allowed in form field


paruby

Recommended Posts

I have form fields for the # of items of an object, ie. a shopping cart.  I want to be able to restrict a user to only enter a specific number range for the quantity of an item in the form field box.  I am not aware of a form field variable such as "maxvalue", but can I do it some other way?  I want to get the max number out of the database.  Not sure if this helps, but I am already using Ajax to set the form field values in database tables, but cannot seem to set a max value.

 

If this is not clear enough, let me know.

 

Thanks

 

Pete

Link to comment
Share on other sites

OK, figured it out.  I am already making a call to my database to get item details, and the starting value of the field, so I just added another variable for the max value, and set that along to my JS/Ajax call, and it f the value of the field is greater than my max value, I change the field value back to the max, and send an alert msgbox to the screen.

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.