PDA

View Full Version : Trying to force users on my site



itmanone
06-17-2005, 05:27 PM
Hi. I am just getting my feet wet w/ JavaScript (so please if I missed following a guidline or broke a posting rule I apoligize in advance) and I need to do the following because of a reporting requirment I have w/ a Search Engine on my page/website.

I have two Input types in my Search Engine, one is a text area where the user can type in their question or keywords they are searching for. The other is a drop down for the user to select the specifc Category they want to search within. (See code below)

Because of a reporting requirment I have, I need to force the users to select the appropiate catagory before the query executes (so I can track accordingly in my reports). Currently the page loads with ("About Cars") selected or showing in the drop down. I want to force the user, even if this defaut ("About Cars") is the correct one to click the drop down and select the appropiate catagory so I know this is "indeed" the area they want to search in.

<form method="POST" action="http://www.domain/search.do">
Type in your question here: <input type="text" size="20" name="searchText" class="searchButton"> search in:
<select name="category" class="searchButton" style="font-size: 9pt">
<option value="/Topics/About Cars">About Cars</option>
<option value="/Topics/About Trucks">About Trucks</option>
<option value="/Topics/About Vans">About Vans</option>
<option value="/Topics/About ATV">About ATV</option>
<option value="/Topics/Other">Other</option>
</select>
<input type="submit" name="Submit" value="Find" class="searchButton" onsubmit="return formCheck(this);">
</form>

Thanks for any and all guidence anyone can give in this matter. :D

mwinter
06-19-2005, 12:16 AM
Because of a reporting requirment I have, I need to force the users to select the appropiate catagory before the query executes (so I can track accordingly in my reports).The only way to force this reliably is to make sure that no meaningful values are selected by default. The user will then have no choice but to select an option before continuing. This could be achieved with a 'Select category' option. I don't think that is particularly desirable though: if a reasonable default is available, that should be used.


Currently the page loads with ("About Cars") selected or showing in the drop down.That is sensible: an appropriate value should be the default. If, for example, the search box is presented at the top of each page, then pages within the Cars section should have 'About Cars' as the default, 'About Trucks' in the Trucks section, and so forth.


I want to force the user, even if this defaut ("About Cars") is the correct one to click the drop down and select the appropiate catagory so I know this is "indeed" the area they want to search in.Sorry, but that is stupid. For a start, if a user sees the right category selected, they won't see any reason to change it. Showing a message that says they need to select a category will just be confusing. I'd certainly wonder what the hell is going on.

More importantly (from your perspective, perhaps) it is not possible to force reselection. Yes, a script could check for manipulation of the control, but scripts can be disabled, bypassed, or ignored completely, so you wouldn't be fulfilling the requirement.

Mike