Limit input box
- Started
- Last post
- 28 Responses
- Raybandana0
never mind - it worked! thanks so much.
- Raybandana0
never mind - it worked! thanks so much.
- Raybandana0
Hmm I found it - but doesn't seem to limit the box.
- Raybandana0
ohhh okay. I dont see any instances of refreshCustomBoxes() in my main.js :P
- BabySnakes0
you shouldn't need that function on the main page like you put.
- BabySnakes0
Well there is a refreshCustomBoxes() function in your jquery.main.js file that needs to be over written by the one i gave you. Save a back up just incase.
- Raybandana0
I added this code - http://jsfiddle.net/vcqe9/1/
So the top of http://delicakitchen.ca/paulette…
Do I need to do more then that? like add a class or something?
- BabySnakes0
You replaced the function exactly or just put the if statement in? Are you updating that first link you sent? hmm should work unless i missed something.
- Raybandana0
Hey BabySnakes,
I added your If statements - but they dont seem to work.
Possibly because I don't know what I'm doing!Any help would be great.
Thanks.
- Raybandana0
thanks guys for the help!
- Nathan_Adams0
Why not use a number input type?
Like a text box, only accepts numbers, and you can set min, max and step values.http://www.w3schools.com/html/tr…
That said, I can't understand what the problem is with fadein11's suggestion of a select box.
- he wants 6 and above to infinite, thats a big dropdown.mantrakid
- Weyland0
pseudo code: onSubmit if(text.length()<6) return else submit
- fadein110
your site needs to rely less on the back button - frustrating.
- BabySnakes0
updated to set the input val to 6 as well...
- BabySnakes0
Added an if statement to the refreshCustomBoxes(), that should force a 6 if user inputs an number less thatn 6 but keeps it at 0 if it is already 0. The each loop for the input boxes isn't set up the way i'd like but it should work.
- Raybandana0
Ahh I understand - thanks for the help - but im trying to be the cool guy... this is what I'm working on.. delicakitchen.ca/paulettes/onlin...
I just want to restrict the input boxes..
- fadein110
If you are trying to be clever or need a really funky solution then look into javascript. If not just have a standard html select box with options 1-5. see link above - just add that with each option 1-5 as part of a form tag, make it look nice with CSS. if i have misunderstood your requirements then apologies.
- Raybandana0
a drop down list with options?
I need a restricted input box. Because I have the form set up a certain way - I cant introduce this kind of style... i would much prefer a restricted input box