November 9th, 2001, 11:20 AM
I've a database. When user logs, see a form he must submit so the search in database begins...
Each result is a page (with next/prev btns) with a table...
All works fine, but i was told to add at the end of the table a little
So, i need to do this...
When user checkes the checkbox, a form must be submitted instantly, so the check user has made is updated in database...
After that, when user logins another day, i should check the state of a BOOL field in that db, so i display the checkbox CHECKED or UNCHECKED (representing 1 if checked or 0 if not...)
The main problem i have is to submit the form when user checks, unchecks the checkbox... besides that... all is fine...
I think it maybe a behavior or anything like that...
am i right?
Thanks 4 reading!
Thanks in advance. C ya!
November 9th, 2001, 12:06 PM
If it's something like that, you can use this:
<input type=checkbox name=check value='1' onclick="submit();">
-- Cigars, whiskey and wild, wild women. --
November 9th, 2001, 12:45 PM
I use this script:
eval('document.' + FormName + '.submit()');
and in my input tag have "onchange='submitForm(formName)'"
so for you it would be:
<input type=checkbox name=whatever value=something onchange=submitform(formName)>
hope this helps
November 9th, 2001, 08:15 PM
All worked... but
When i click the checkbox the form submits fine... but i can check the $var only when checkbox is checked...
If checkbox is checked and i uncheck it, the form submits but the $var_checkbox is empty or null...
But when the checkbox is unchecked and i check it, the form submits and the $var_checkbox is with its value...
Is any way to "fix this"?
Thanks in advance.
Hope you've understood me...
November 9th, 2001, 11:58 PM
No...that's the way it works. If it's not checked, the variable is null.