I have a website that uses a View with exposed filters and the Finder module to search for jobs. One of the criteria is salary range, which is displayed in British Pounds in a select box with 4 options. However, the client has asked for an option that allows the user to display a different currency.
I have created a module that allows a user the select a different currency, which in turn sets a session variable containing a currency value. When the user views a page containing either the Finder search form or the Views exposed filter, Drupal adds some JQuery which changes the visible values of the select box based on the value of the session variable. However, it does not change the actual values of the select options - only what the user can see.
Unfortunately this method throws the "illegal choice has been detected please contact the site administrator" error, obviously because the posted form array doesn't match the form array stored by Drupal. So the question is, how can I stop this error from occurring? I was thinking of the form values being reset by JQuery just before submit, although I'm not sure how I would change the values between the user clicking the submit button and the form actually being submitted. Another choice is perhaps hook_form_alter to change the form values, but I'm not exactly sure if this would work either.
Any ideas?