I am using a form field to capture stats of a particular situation. I need the value of a hidden field to change based on the input of two text fields. I will describe the function in plain English. Help translating this to a functioning jQuery script would be greatly appreciated.
Hidden field equals 'yes' where the value of field_1 equals 4 && field_2 equals 2 or Hidden field equals 'yes' where the value of field_1 equals 3 && field_2 equals 1 or Hidden field equals 'yes' where the value of field_1 equals 2 else Hidden field equals 'no'
As indicated by the structure of the statement, I'm a php developer first. It is my assumption that this can be done via jQuery. If not, provide me with an alternative. Thanks!
Hope this helps. Check out jQuery api incase your fields are different some how (like if they are checkboxes)
The following use the keyup event handler to modify the hidden input value based on the input value of field_1 and field_2 (assuming they are text input).