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
Share on other sites

This is a JS problem.

 

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

 

<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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.