SPrelewicz
Programmer
This started on the mySQL board, but now must be switched to here. Below is a response from a user about checkboxeses:
What I might do with an HTML interface is produce a set of checkboxes with all the possible content, and check by default all those which represent content to which the user is subscribed.
I would also place a set of related hidden HTML form elements in the form to record what which checkboxes were already selected checkboxes at the time the page was produced.
When the form is submitted, another script can scroll through the checkboxes that are selected at the time the form is submitted. For each checkbox submitted, your script can compare the value as it is with the hidden value as it was.
If a checkbox is checked, but there is no related hidden field, your script can assume that the content was previously unsubscribed,and subscribe your user.
If a checkbox is not returned it is because it was not checked. You will have to loop through the hidden fields (those checkboxes already checked) to see which ones were checked previously, but are now not checked. Unsubscribe your user.
If there is a submitted checkbox and a related hidden field both, then the user was already subscribed and elects to remain subscribed. Do nothing.
--------
The problem is, I'm not sure how to do this in Perl. I'm sure I could come up with a hack if I thought long enough, but I doubt it would be the cleanest or quickest way. Can anyone help? Here is the entire thread.
thread436-578830
What I might do with an HTML interface is produce a set of checkboxes with all the possible content, and check by default all those which represent content to which the user is subscribed.
I would also place a set of related hidden HTML form elements in the form to record what which checkboxes were already selected checkboxes at the time the page was produced.
When the form is submitted, another script can scroll through the checkboxes that are selected at the time the form is submitted. For each checkbox submitted, your script can compare the value as it is with the hidden value as it was.
If a checkbox is checked, but there is no related hidden field, your script can assume that the content was previously unsubscribed,and subscribe your user.
If a checkbox is not returned it is because it was not checked. You will have to loop through the hidden fields (those checkboxes already checked) to see which ones were checked previously, but are now not checked. Unsubscribe your user.
If there is a submitted checkbox and a related hidden field both, then the user was already subscribed and elects to remain subscribed. Do nothing.
--------
The problem is, I'm not sure how to do this in Perl. I'm sure I could come up with a hack if I thought long enough, but I doubt it would be the cleanest or quickest way. Can anyone help? Here is the entire thread.
thread436-578830