• Resolved reneeholiday

    (@reneeholiday)


    I am converting a client’s static site to a WordPress site. They want me to include an INTEREST CALCULATOR.

    See original calculator on the old/static site here http://www.floridacollections.com/interest.htm

    I have pasted the form/table into the RESOURCES page. See it here http://www.dominant-paradigm.com/flcollections/resources/

    And I put the head javascript into the HEADER of the theme. I also turned off the rich editor before pasting the code.

    But I really do not know anything about javascript. So I am stumped, even after reading the codex page about inserting javascript. I could create an external .js file to remove the code from the header. But I don’t know how exactly to CALL it, on the Resources page.

    Please advise.

    Many thanks!
    renee

Viewing 3 replies - 1 through 3 (of 3 total)
  • Renee,

    Hi
    If you look at the html source you will notice that the form is started and terminated on the same line with no form elements enclosed. When you scroll down the page, you will notice the form elements are present in the document – but they are OUTSIDE of the form tags. This is the cause of the javascript malfunctioning.

    WordPress MAY be terminating the form tag for you as a security measure – not sure on this though.

    Here’s what I would do:

    Create a new template file. I would name it template-interest-calculator.php. Save this file in your theme’s directory. The first thing that goes in the file is:

    <?php
    /*
    Template Name: Interest Calculator
    */
    ?>

    Next, copy and paste the code from your theme’s single.php file. Then, I would hard code the form into the template file directly above or below The Loop.

    Next, you will need to go to you wordpress admin section and apply the new template to your page. Navigate to ‘Manage’ -> ‘Pages’ and click edit on the page that contains the calc…

    1. Delete all form code from the ‘Page Content’ box.
    2. Select “Interest Calculator” from the ‘Page Template’ tab on the right hand side bar.
    3. Click “Save and Continue Editing” and preview your page in a new tab.

    Hope this helps,
    -Mike

    Thread Starter reneeholiday

    (@reneeholiday)

    Mike,

    Fantastic!!! It worked. I learned something very useful, thanks to you!

    Many thanks!!!
    renee

    Mike,

    I, too, want to thank you for this lesson. You made my life a whole lot easier with this. Thank you!

    Ryan

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘please help with javascript calculator/form’ is closed to new replies.