|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hey all,
Quick question. I've got a generic form a person can fill out. After they fill it out, the user has the option of coming back and editing various things, address, email, and which subscriptions they would like to receive. so here's the problem: when they come back to edit there information they can use check boxes to subscribe/unsubscribe. Which looks like this: <input type=checkbox name=news1 value="$user[10]" where $user[10] is it's placement in the mysql table. Now how do I get part to work? I'm sort of lost, wanting them to be able to add a list (value of 1) and delete it (NULL value). Thank you in advance for the help. |
|
#2
|
|||
|
|||
|
I'm not quit sure what you're asking, but I'll give it a shot.
###### if($user[10] eq "1") { <input type=checkbox name=news1 value="1" checked> } else { <input type=checkbox name=news1 value="1"> }#end if. ###Of course you'd have to put those in print statements. Then when the info comes back to the script: #### if($FORM{news1} eq "1"){$user[10]=1} else {$user[10]=0;}## or whatever you want them to equal. #### $FORM{news1} is the checkbox's parsed value. Is this what you wanted? |
|
#3
|
|||
|
|||
|
Oh yes. That worked out great!
Thanks. ![]() <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Loki: Hey all, Quick question. I've got a generic form a person can fill out. After they fill it out, the user has the option of coming back and editing various things, address, email, and which subscriptions they would like to receive. so here's the problem: when they come back to edit there information they can use check boxes to subscribe/unsubscribe. Which looks like this: <input type=checkbox name=news1 value="$user[10]" where $user[10] is it's placement in the mysql table. Now how do I get part to work? I'm sort of lost, wanting them to be able to add a list (value of 1) and delete it (NULL value). Thank you in advance for the help.[/quote] |
|
#4
|
|||
|
|||
|
N/P
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > input value, checkbox, form, and mysql |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|