Checkboxes, Disabled, and Back

admin

Administrator
Staff member
I am writing a search engine. My search page has four different categories (uploader's name, upload date, file type, keywords). Each has a checkbox beside it; the checkboxes are in an array.

When the page loads, all of the boxes are unchecked and the search button is disabled by default. The user checks which search criteria he wants to use and hits submit. I wrote it so that the submit button is enabled if one or more boxes is checked and disabled if no boxes are checked. All that works fine. I hit submit, I see my search results.

The problem I'm having is that when I click the Back button, my checkboxes are checked the way I left them and the dropdowns and textboxes are populated the way I left them. However, the submit button is disabled.

I tried hardcoding with a for loop that iterates through each checkbox, and if any is checked to enable the button. I put a few alerts and verified that the scripts are being executed when I click Back. I am using IE 6.0 SP1. It seems like when I click Back, the form is displayed, the script is run, and then the form elements are populated.

Is there any way around this?
 
Back
Top