0

I'm trying to figure out how I can make my form popup when someone hits yes. How do I incorporate this...?

Here's the JSFiddle: http://jsfiddle.net/VqqWW/

Here's the form:

<script type="text/javascript" src="http://form.jotform.us/jsform/32217646901149"></script>

I've tried putting,

if (q1 == "Yes") {
      document.getElementById("linkDiv").innerHTML = "<script type="text/javascript" src="http://form.jotform.us/jsform/32217646901149" />";
    }

That doesn't seem to work and I've also tried putting the code somewhere else in the head and linking it to that script but I'm not sure what's wrong.

2 Answers 2

1
function loadForm(){
    var fileref = document.createElement('script')
    fileref.setAttribute("type","text/javascript")
    fileref.setAttribute("src", "http://form.jotform.us/jsform/32217646901149")
}

Stole this from this site.

Sign up to request clarification or add additional context in comments.

1 Comment

I want the form to pop up instead of the "Hello" popping up when I click yes.
0

I'm not sure what you have done in that jotform script. However instead of creating new script files, generate the form(jotform) dynamically and add it in the innerHTML or make a reference variable to script and call it here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.