Page 1 of 1
Instant value Checkboxes
Posted: Thu Mar 03, 2005 3:32 pm
by jbstone713
Is there a way to instantly store a value in a checkbox without clicking submit (just check it)?
Posted: Thu Mar 03, 2005 3:34 pm
by John Cartwright
Do you mean like the checkbox is already checked when you go to the page?
Be a bit more specific
Posted: Thu Mar 03, 2005 3:41 pm
by feyd
whatever it is.. it ain't php code.. Moved to Client-side.
Posted: Thu Mar 03, 2005 11:30 pm
by jbstone713
No, I know that I can specify a checkbox to be checked or unchecked when the page first loads. I mean when a person actually clicks a checkbox, the value is instantly stored. I have a form that has a hyperlink that "adds favorites" and returns to the same page. If a user selects a checkbox(without clicking submit) and clicks on the "adds favorites" link, the checkbox is now unchecked. However, if a user selects a checkbox, then he clicks submit(and he got returned to this form because of user error), and he then clicks on an "adds favorites" link, the checkbox will remain checked. I built in form handling to ckeck for required fields. The values of a checkbox will only be passed if the user selects a checkbox, and then clicks submit. If he selects a checkbox and doesn't click submit, there is no value. Any idea how I can instantly store a value the instant a checkbox is selected?
Posted: Thu Mar 03, 2005 11:43 pm
by feyd
why not just have the "adds favorites" link submit the form?
Posted: Fri Mar 04, 2005 8:08 am
by jbstone713
I thought about that, but I have an add favorites link for each individual item that is displayed on the same page. Each link works only for that particular item. If a user is scrolling down, checks a box(but doesn't want it in his favorites, then decides to add a different item into his favorites further down the page, the checked checkbox that he clicked above will dissappear! That is why I need a way to instantly store a value once a checkbox is clicked.
Posted: Fri Mar 04, 2005 8:10 am
by feyd
so you have a form for each check box? Why not make them one large form so they can add and remove "favorites" as they wish?
Posted: Fri Mar 04, 2005 3:04 pm
by jbstone713
I already have one large form, but combined I also need to have individual links to add and remove "favorites" as they wish? I need this to be set up this way so the user only has access to certain items at certain times. I don't want to have a page displaying all items. They must be done this way.