- This topic has 6 replies, 2 voices, and was last updated 7 years, 4 months ago by Mahesh.
-
AuthorPosts
-
December 9, 2016 at 3:31 pm #105008bobgarrettParticipant
Hi, I hope you can help.
I am using a plugin (form-maker) for a form which requires some javascript to be executed onload. This is not working it appears because the code is having <p> inserted by the theme.
For example:
<p> if(window.before_load)
{
before_load();
}
}</p>
<p> jQuery(window).load(function () {
formOnload24();
});</p>Is it possible to change a setting so the script is not interrupted by this?
December 9, 2016 at 4:19 pm #105012MaheshKeymaster@bobgarretthomenetworks-co-uk: Where have you actually put these codes? I recommend you to create a child theme and then enqueue the script in child theme’s functions.php. You can find more details on creating child theme HERE.
Regards,
MaheshDecember 9, 2016 at 5:10 pm #105015bobgarrettParticipantThe form-maker plug includes the option to specify javascript for such inclusion. You can see the actual page: http://www.ccrc.co.uk/temp/
If a child theme is needed I will look at this but I don’t think it should be necessary. Also, I am not sure whether I would then need a range of child themes for different forms. Whereas if the script was executed as it is it would be easy.December 9, 2016 at 9:43 pm #105041bobgarrettParticipantProblem is solved I think. It was my error in implementation.
December 12, 2016 at 9:48 am #105187MaheshKeymaster@bobgarretthomenetworks-co-uk: Glad to know you’ve solved the issue by yourself. Have a nice day!
Regards,
MaheshDecember 12, 2016 at 3:47 pm #105207bobgarrettParticipantApologies for confusion over this and thanks for your assistance but the problem is not completely solved.
Although am now feeding the text through to the field it is clearly not as content but more as a hint. I had expected a visitor to be able to edit the text; instead, clicking in the field makes the text disappear. Can it be made editable as content?December 12, 2016 at 4:28 pm #105211MaheshKeymaster@bobgarretthomenetworks-co-uk: Sorry, this is not possible.
Regards,
Mahesh -
AuthorPosts
- The topic ‘Javascript being excluded by’ is closed to new replies.