I created a simple application for a project. Basically, the webpage has a text box and when the content in that contains certain keywords, it changes the contents of the page. It was all working fine, until I created a mobile version of it. Now, the mobile version still works flawlessly, but, the desktop version does nothing I have attached my file. Someone please, help.
P.S.: The text box will respond to any one of the following keywords at a time (case sensitive):
headache
chest
joint
tooth
stomach
cough
Also, do not press enter. It’s not a form. It won’t respond to that. Just click on ‘Help Me!’.
You’ll need to create either separate JavaScript functions for this document so that the form id ‘symptoms’ is different between your two layouts, or use classes to retrieve the value of that input field. As it is now, you have two input forms and both use the element id ‘symptoms’ so the JavaScript function is trying to retrieve the value from both and getting confused. The quickest way to fix this would be to duplicate the JS function check and make a mobile version that reads the value of symptoms-mobile, and then adjust the ID of the input form you have in the mobile layout.
There are likely a few ways to do this.
But maybe the simplest for this project is not to try and click the button with click() to call your check() function.
You do to need to.
In Hype you can call it’s functions by using it’s hypeDocument.functions() API .
So you can use this to call the check() function.
Yeah, this one is totally my bad. I had turned off my laptop to go to bed and got your solution. Turned it back on and just copy-pasted your code. Saw, it didn’t work and came here to message. Went to bed and realised that I had changed all the names. So, worked on it as the first thing in morning. It works! Thanks a lot!