You need to sign in to do that
Don't have an account?
Vandana Rattan 4
Salesforce1 HTML select onChange function not working in Salesforce1 IPAD app
I have created an HTML5 VF page to be used in Salesforce1 app. It has a select list Called Event Name with values:
Presenation
Lecture
Other
There is another text field called Type. This has to be displayed only if Event Name is Presenation. Otherwise it should be hidden. I implemented it using onChange event for the select list. It works perfectly if I run the page using https://[InstanceName].salesforce.com/one/one.app
But when I try to access the page using Salesforce1 IPAD app the page hangs. Kindly Suggest. Code:
Presenation
Lecture
Other
There is another text field called Type. This has to be displayed only if Event Name is Presenation. Otherwise it should be hidden. I implemented it using onChange event for the select list. It works perfectly if I run the page using https://[InstanceName].salesforce.com/one/one.app
But when I try to access the page using Salesforce1 IPAD app the page hangs. Kindly Suggest. Code:
HTML <select name="EventName" id="EventName" data-mini="false" onChange='CheckEvent(this.value)'> <option value="Presentation">Presentation</option> <option value="Lecture">Lecture</option> <option value="Other">Other</option> </select> <input name="Type" for="Type" id="Type" style='display:block;'> </input>
JS function CheckEvent(val){ var element=document.getElementById('Type'); if(val=='Presentation'){ element.style.display='block'; } else{ element.value=''; element.style.display='none'; } }
Just to cover some basics:
- Ensure you are on a supported device and OS (iOS 8+).
- Check for any Salesforce1 updates.
- Fully restart Salesforce1 (double-tap home button and swipe app up off screen).
Salesforce1 requirements for reference:
https://help.salesforce.com/apex/HTViewHelpDoc?id=sf1_requirements.htm&language=en_US
Try these steps and also use this code in a blank Visualforce page to test again if there is other code in place.
When the page hangs, are you saying that you are able to change the select list value but the input field does not hide/show? Or do you mean you cannot even use the select list to pick a value?