marcuspiercce Posted September 2, 2010 Share Posted September 2, 2010 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 More sharing options...
marcuspiercce Posted September 2, 2010 Author Share Posted September 2, 2010 This got moved to JavaScript help, but it's from a PHP file. Not sure if that matters. Link to comment https://forums.phpfreaks.com/topic/212322-total-newbie-simple-url-link-onclick/#findComment-1106294 Share on other sites More sharing options...
Omirion Posted September 2, 2010 Share Posted September 2, 2010 So let me get this straight. That's the code for a form. And you want it to just go here http://pceh.org/?page_id=438 ? I really don't understand what you are trying to do. Link to comment https://forums.phpfreaks.com/topic/212322-total-newbie-simple-url-link-onclick/#findComment-1106307 Share on other sites More sharing options...
marcuspiercce Posted September 2, 2010 Author Share Posted September 2, 2010 Yep. That's it. i just have no idea and I don't want to try and end up breaking something. If it was HTML I could do it, but I don't know if it is different because it is in a PHP file. Link to comment https://forums.phpfreaks.com/topic/212322-total-newbie-simple-url-link-onclick/#findComment-1106309 Share on other sites More sharing options...
Adam Posted September 2, 2010 Share Posted September 2, 2010 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. Link to comment https://forums.phpfreaks.com/topic/212322-total-newbie-simple-url-link-onclick/#findComment-1106413 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.