Replies: 0
Hi,
I’m trying to stop autocomplete filling in one of the fields on a form, the form I have linked will show the issue somewhat but I am currently working on a new form where it is really noticeable and makes it so I cannot make the new form live yet.
The field I want to not autofill is the county field which is a dropdown menu, which is a recipient list where any reports that come in get sent directly to the person responsible for that county. On this particular form its not too bad because the person filling it in can just switch it easily to the desired county, however the new form I am working is another story. Basically at the moment we only take reports for English counties, but we now want to be able to take reports from all of the UK, so I wish to add Scotland and Wales. To do this on the new form I have created I have another dropdown menu for countries, which is England, Scotland and Wales, and once a country is selected I’m using the conditional fields for contact form 7 plugin to then show one of three dropdown menus depending on the country selected which will then have the separate counties in the list. So my problem is that with autofill if someone autofill’s from their name lets say to fill in the rest, email, phone etc and if they have their address in as autofill it will select their home county from the dropdown event if the field is hidden using the conditional field. For example, if someone lives in England and they go on holiday in Wales where they see the animal we want them to report, if they then go to the form and autofill then select Wales as the country followed by the county in Wales but they do not see that autofill has select their home county. This results in us seeing two counties reported in the email message body, one for England and another for Wales in this example. This is problematic because of how the form knows who to send the message to because of using ‘recipient’.
I found some code on this site from about 5yrs ago that could be added to the functions.php file but for some reason I cannot get it to work, I replaced the tag examples in it, which was FirstName and LastName to the tags I’ll be using, which is ‘recipient’ ‘recipent-1’ and ‘recipient-2’ for the counties in the three countries.
Any help would be greatly appreciated.