What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
Possible to conditionally show/hide a Text Field based on User Agent (browser type)?Asked by jcarriere on September 02, 2015 at 04:41 PM
Looking to show a specific text field to users viewing the form on a certain platform only. Is it possible to detect the User Agent, then conditionally show or hide a specific text field?
Browser Type A (Chrome) -> Hide Text Field 1
Browser Type B (Safari) ---> Show Text Field 1
Thanks for any insight
Great! Do you have a list (however specific or condensed it may be) of the general returns this field generates so I don't have to submit X amount of test orders across different devices to see how I need to specify my conditions?
I'm mostly aiming at Internet Explorer, if possible to specify version that would be helpful.
Here is a list of all the user agent strings for IE:
These are the same string that will be displayed from the widget, depending on which browser was used.
If you have any further questions, let us know and we will be happy to help.
I've made some attempts with this, and am having hit and miss results. Here is a screen shot of my Conditions for the Browser Information in regards to showing or hiding two cosmetic fields (an h2 header and a text field).
Interestingly, when testing in IE 8 and IE 7, the header is shown, but the text field underneath it does not and I cannot for the life of me figure out why that is.
Also, I am receiving some warning dialogue boxes when loading the page in which my form is embedded (iframe embed):
IE 7 Warning: http://i.imgur.com/2PDlVyN.png
Any insight or help is appreciated.
Since IE7 and 8 will no longer be supported at the end of this year by Microsoft, any script errors and such that occur in either one are likely to not be addressed. If you wouldn't mind providing us with the URL of your page, we will be happy to take a look, though I cannot guarantee that a fix will be implemented.
Disregarding the warning dialogues, do you have any insight as to what about my conditions are not functioning correctly?
(Private)Answered by Boris on September 04, 2015 at 01:01 PM
It seems that Internet Explorer, in its earlier incarnations, didn't support functions that we use for the Contains matching.
You should try using Starts with matching instead, as this works fine on Internet Explorer 8:
You can use the following two rules to match most versions of Internet Explorer 8 on the market:
Mozilla/4.0 (compatible; MSIE 8.
Mozilla/5.0 (compatible; MSIE 8.
I am not sure about Internet Explorer 7, as I don't have this version available for testing. I hope this helps.