- TSMProductionAsked on January 08, 2013 at 05:22 PM
I am trying to change some values on a page load.
I am using this code to achieve this:
$("#input_5").append("<option>This is new</option>");
I get this error when I load the page:
"'null'" is not an object"
I only get this error when the script "http://max.jotfor.ms/min/g=jotform?3.1.1316" is loaded on the page. Is there anything that would be conflicting with this? I see that it's not finding the id "input_5".
Thanks for your time!
- jeanettebmzAnswered on January 08, 2013 at 05:43 PM
Please insert right after this code, the following line:
I hope this helps
- TSMProductionAnswered on January 09, 2013 at 10:02 AM
Thank you for the response. I placed the script right after the jquery library but it does not seem to be working. I get the error "'undefined' in not a function".
- jeanettebmzAnswered on January 09, 2013 at 10:06 AM
Can you please explain what is the action that makes you to get this error? I open the URL where the form is shown, and we would like to reproduce the error
- TSMProductionAnswered on January 09, 2013 at 10:29 AM
I am trying to add a new option to the dropdown menu as soon as the page loads. I'm using the Chrome console to catch the errors on the page load.
The URL that I posted is just me testing to see if I could actually achieve this.
I attached a screenshot of the error in chrome:
- JotForm SupportabajanAnswered on January 09, 2013 at 11:32 AM
Upon viewing the page's source, I noticed that the type attribute is missing in your custom scripts' tags. Although it's not required in HTML5, speaking under correction, I beleive it is required in pages having an XHTML doctype (even transitional ones). Including the attribute may not solve the problem but insert it anyway to be on the safe side. I'm pretty sure it's a conflict between Prototype and jQuery that's the main cause of problem though.
- JotForm SupportabajanAnswered on January 09, 2013 at 11:50 AM
The following video may also be helpful:
(It's advisable to view it fullscreen in HD: Either 720p or 1080p)
- JotForm SupportabajanAnswered on January 09, 2013 at 12:46 PM
Using the video as a guide, I was able to fix the issue. Please view the source of this demo for the solution.
- TSMProductionAnswered on January 09, 2013 at 01:26 PM
That does the trick! Thanks so much for solving that.
- JotForm SupportabajanAnswered on January 09, 2013 at 01:29 PM
Glad we could help :)
Do let us know if there's anything else with which you may need assistance.