Jump to content

Total newbie: Simple URL link, onClick


marcuspiercce

Recommended Posts

I don't know PHP at all. I have this Wordpress theme that has a button that calls some function that I don't need. I just need it to go to another page on my site. I have no idea how to format this in PHP. Here is the code:

 

                          <form action="" method="post" name="opt_form">

                              <!--  <input type="text" name="opt_name" id="opt_name" value="<?php _e('Name')?>" onfocus="clearDefault(this)" onblur="restoreDefault(this)" class="textfield" />

                                <input type="text" name="opt_email" id="opt_email" value="<?php _e('Primary Email')?>" onfocus="clearDefault(this)" onblur="restoreDefault(this)" class="textfield" />

                                <input type="text" name="opt_data" id="opt_data" value="" class="textfield" />  -->

                                <input type="submit" name="opt_submit" id="opt_submit" value="Make A Donation" onclick="return optformValidate(document.forms.opt_form)" />

 

 

I assume what I need to change is that last input line, but I don't want to screw something up. I just need it to go to a URL for another page in my site, which is here: http://pceh.org/?page_id=438. I don't know if the URL should be relative, or even how to format it. I'm one of you guys or girls can tell me how to do this in two minutes. Thank you very much in advance.

 

--Marcus Pierce

www.pceh.org

mpierce@pceh.org

                            </form>

Link to comment
https://forums.phpfreaks.com/topic/212322-total-newbie-simple-url-link-onclick/
Share on other sites

This is a JS problem.

 

I imagine the problem lies with the function you're calling on submission:

 

  Quote
<input type="submit" name="opt_submit" id="opt_submit" value="Make A Donation" onclick="return optformValidate(document.forms.opt_form)" />

 

Notice the return before that call; that means if the function returns false it'll prevent the form being submitted.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.