Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Help with Javascript Calculator/Form


  #1  
Old Sep 2, 2009, 09:44 PM
SupraTT's Avatar
SupraTT
 
78 posts · May 2009
I hope someone can help me here. I been trying to get a javascript form for a calculator to work on a post or page.

I found this thread, where the OP had a similar question:

http://wordpress.org/support/topic/147154

Basically, the solution was to make a copy of single.php and hardcode the javascript form into the new template.php.

Can someone guide me in the righ direction in doing this with Atahualpa? I tried copying index.php to a new file named calc.php, but even before inserting my javascript code it will not even load (just produces errors).

Thank you
  #2  
Old Sep 2, 2009, 10:28 PM
SupraTT's Avatar
SupraTT
 
78 posts · May 2009
Okay, I actually figured out how to make the template page and put my code in. However, the problem I am having is that when I tryt submit the form, all I get is a "Not Found" page error. Is it because my php variables are not set or are lost when I submit the form?

I know the code works, because if I make a standalone .php page, I am able to use the calculator. I do have the following above the header for my .php page:

Code:
<?php
// Initialize the variables
if (isset($_POST['L'])) {
    $L = $_POST['L'];
}
if (isset($_POST['c'])) {
    $c = $_POST['c'];
}
if (isset($_POST['cp'])) {
    $cp = $_POST['cp'];
}
if (isset($_POST['n'])) {
    $n = $_POST['n'];
}
if (isset($_POST['P'])) {
    $P = $_POST['P'];
}
if (isset($_POST['Pp'])) {
    $Pp = $_POST['Pp'];
}
if (isset($_POST['p'])) {
    $p = $_POST['p'];
}
if (isset($_POST['Calculate'])) {
    $Calculate = $_POST['Calculate'];
}
?>

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Styling the comments area title font, form field and label font, and form field sizes jkintzele Comments, trackbacks & pings 5 Nov 10, 2009 09:18 AM
Instal BMI Calculator tarragon Plugins & Atahualpa 1 Aug 23, 2009 09:09 AM
[3.3.3]Javascript Rotation Question Pxl_Buzzard Header configuration & styling 2 May 9, 2009 05:18 AM
Issue with Javascript and Lightbox brigade Atahualpa 3 Wordpress theme 1 Feb 23, 2009 03:11 PM
Help with javascript dock menu Ace Header configuration & styling 2 Feb 20, 2009 02:50 PM


All times are GMT -6. The time now is 05:33 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.