Wanting to make it as easy as possible for my users to add a bug or feature request, I added the ability to specify the projectid and categoryid in the URL and have the drop down boxes automatically selected with the given values. I then add links in my applications containing these preselected values, which the user may click to easily report a bug or make a feature request.
In the case of the project, I had to also add a foreach loop to walk the project dropdown box and select the item, just like the existing code does for several of the other dropdown boxes. In the case of the category, I simply added an if before the check for defaults. Therefore, for the way I implemented this, a category in the URL overrides a default. In either case, if the value is not given, is non-numeric, or a project or category with that id does not exist, it is simply ignored.
I have attached my code. I made changed in two locations, both marked with the, "Preselect."
Sign up for the SourceForge newsletter:No, thanks