06-02-2009, 05:59 AM
|
#9 (permalink)
|
|
The Contributor
Join Date: Nov 2008
Location: Sweden
Posts: 36
Thanks: 1
|
Quote:
Originally Posted by Kay1021
ok lets say i have a form
PHP Code:
<form action="page2.php" method="POST">
<label class="checked">
<input type="checkbox"/>
Tick me, tick me!
</label>
</form>
now I want to take the result of that (whether it's checked or not and input into my database so that when i display later...it will show the appropriate answer
I'm just not understanding this part of the whole thing...like what's the variable the holds this information so that input it into the database.
I'm sure this easy stuff...but for some reason i'm not getting it right now. Driving me crazy! It's not even that i'm having errors because i don't know where to start other than what's above and being connected to all the appropriate css and js.
Hope this makes sense
|
Well first of all what the javascript does is nothing more than visual aspect of things since the support for styling form elements vary from browser to browser.
The actual input element is then hidden or pushed out the screen with the help of css and then updated on interaction with javascript.
So do your forms as you normally would do, i.e give it a name, value and id (if you want to target that element on it's own)
Quote:
|
<input type="checkbox" name="some_name" value="some_value" />
|
Then do as you would insert any other form element to the database, as in this case is $_POST["some_name"].
|
|
|
|