figure2
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Trying to convert a form using javascript to wordpressThanks stvwlf for that info. Being relatively new to wordpress, I did not know the path WP needed to find the file. I will definitely try this and let you know if it works. I am assuming that the same path is true to link to images an other resources.
I apologize I can’t show you the current site in development as it is currently being developed locally in MAMP.
One other option I was wondering about was jquery. As a non-programmer, my skills in jquery are shaky at best. As an example I can show the contents of “clg_Membership.js” followed by my unsuccessful attempt to convert it to jquery. If anyone can offer a way to fix my code I would appreciate it:
//Current contents of clg_Membership.js which changes the value of the "amount" //text input field in the paypal form based on the selected index of //the pulldown menu. function changeValue(){ var price=0; if (document.clg_memberForm.os0.selectedIndex == 0){ price = 10; document.clg_memberForm.amount.value = price.toFixed(2); }else if (document.clg_memberForm.os0.selectedIndex == 1){ price = 20; document.clg_memberForm.amount.value = price.toFixed(2); }else if (document.clg_memberForm.os0.selectedIndex == 2){ price = 30; document.clg_memberForm.amount.value = price.toFixed(2); }else if (document.clg_memberForm.os0.selectedIndex == 3){ price = 35; document.clg_memberForm.amount.value = price.toFixed(2); }else if (document.clg_memberForm.os0.selectedIndex == 4){ price = 50; document.clg_memberForm.amount.value = price.toFixed(2); }else if (document.clg_memberForm.os0.selectedIndex == 5){ price = 75; document.clg_memberForm.amount.value = price.toFixed(2); }else if (document.clg_memberForm.os0.selectedIndex == 6){ price = 100; document.clg_memberForm.amount.value = price.toFixed(2); }else if (document.clg_memberForm.os0.selectedIndex == 7){ price = 200; document.clg_memberForm.amount.value = price.toFixed(2); }else if (document.clg_memberForm.os0.selectedIndex == 8){ price = 500; document.clg_memberForm.amount.value = price.toFixed(2); }else if (document.clg_memberForm.os0.selectedIndex == 9){ price = 60; document.clg_memberForm.amount.value = price.toFixed(2); }else if (document.clg_memberForm.os0.selectedIndex == 10){ price = 150; document.clg_memberForm.amount.value = price.toFixed(2); }else if (document.clg_memberForm.os0.selectedIndex == 11){ price = 350; document.clg_memberForm.amount.value = price.toFixed(2); }else if (document.clg_memberForm.os0.selectedIndex == 12){ price = 750; document.clg_memberForm.amount.value = price.toFixed(2); } }//My unsuccessful attempt to convert this code to jquery $(document).ready(function() { switch ($('#on0 :selected').index()) { //on0 is the id of the pulldown menu case $(this).index() == 0: $("#amount").val("10.00"); break; case $(this).index() == 1: $("#amount").val("20.00"); break; case $(this).index() == 2: $("#amount").val("30.00"); break; case $(this).index() == 3: $("#amount").val("35.00"); break; case $(this).index() == 4: $("#amount").val("50.00"); break; case $(this).index() == 5: $("#amount").val("75.00"); break; case $(this).index() == 6: $("#amount").val("100.00"); break; case $(this).index() == 7: $("#amount").val("100.00"); break; case $(this).index() == 8: $("#amount").val("100.00"); break; case $(this).index() == 9: $("#amount").val("500.00"); break; case $(this).index() == 9: $("#amount").val("60.00"); break; case $(this).index() == 10: $("#amount").val("150.00"); break; case $(this).index() == 11: $("#amount").val("350.00"); break; case $(this).index() == 12: $("#amount").val("750.00"); break; } }Forum: Fixing WordPress
In reply to: Trying to convert a form using javascript to wordpressThanks stvwlf,
Actually the form’s functionality is fine. It’s the javascript the form calls which isn’t working. Will this plug-in make the javascript work?
If so, where does the script tag referencing the .js file go – in the header or in the custom field with the form?