I have 6 different branch dropdowns which are a list of peoples names. When a name is chosen from one of the drop downs it will be prefilled into a textbox that I have set to hidden and readonly like so
<div id="employeechosen" class="form-group">
<input type="hidden" name="chosen" id="chosen" class="form-control" required="" readonly>
</div>
In some of these lists are names that I do not want to allow and I remove them from the list using jquery like so:
$("#DES option[value='David']").hide();
$("#DES option[value='Vicki']").hide();
What can I do to stop people from being able to enter anything they want beyond this? All a user would have to do is hit f12 and change input to text and delete readonly and proceed to do what I do not want them to able to do.
What is the best way to lock down a text box to not be compromised?
What could I write in coldfusion to check for those names upon submit and stop the form from processing instead of carrying on with the password change?
JQUERY
$(document).on('change', '#chosen', function() {
var value = $(this);
var anyname = $('#DES, #DLO, #LR, #NR, #PS, #TRG');
if (value.val() === anyname.val()) {
alert('true');
} else {
alert('Try again and you will be fired...');
anyname.val('');
value.val('');
}
});
I know how to do this client side version with jquery but anyone really trying to crack it client side will be able to do so. How do I do this server side with Coldfusion?
Any help would be greatly appreciated!
What iv tried but is obviously not correct:
<cfif isDefined("form.submit")>
<cfif form.chosen eq VickiH>
<cfoutput>true</cfoutput>
<cfelse>
<cfoutput>false</cfoutput>
</cfif>
</cfif>
Why does nothing display when I hit the submit button?
listFindNoCase(). - Henry