I am using wordpress 3.3.1 with twentyten theme,
i have created a plugin to create a custom form,
i have successfully installed this in wordpress,
my plugin file code is as follows
<?php
function guest_event_form()
{
if(isset($_POST['submit']) and $_POST['action']=='new registration')
{
global $wpdb;
$wpdb->query("Insert Query...");
}
else
{
?>
<form method="POST" action="" name="guest_registration" enctype="multipart/form-data">
<input type="text" id="name" name="name" value="">
<input type="submit" name="submit" value="Register Me Now"/>
<input type="hidden" name="action" value="new registration" />
</form>
<?php
}
}
add_shortcode( 'guest_event_form', 'guest_event_form' );
?>
whenever i am submitting this form, i returns to same page with search results,
so i guess the problem whenever i submit this form, wordpress takes this submit action as a search action, and it starts search
how do i overcome this problem??
The Problem is because of following form element's id
<input type="text" id="name" name="name" value="">
name is one of the wordpress internal variable
Change it like this:
<input type="text" id="customername" name="customername" value="">
Related
In my plugin I have an action in my form that is supposed to take me to a template page called go, but when I click on it wordpress tells me that it does not exist but if I refresh the page then it loads up the go page. Any ideas why it wont just load normally and how to fix it?
<form name="trailer-bulk-waste-free" method="post" action="go">
<input type="hidden" name="date" value="<?php echo"$date"; ?>">
<input type="hidden" name="pickup" value="<?php echo"$pu" ?>">
There is a bunch of other inputs in here but probably redundant to put.
<p><input type="submit" name="CONTINUE" value="CONTINUE" />
An easy and straight forward way is to assign the go page template to a page. Let's say ID of that page is 77, then do this.
<form name="trailer-bulk-waste-free" method="post" action="<?php the_permalink( 77 ); ?>">
<input type="hidden" name="date" value="<?php echo"$date"; ?>">
<input type="hidden" name="pickup" value="<?php echo"$pu" ?>">
There is a bunch of other inputs in here but probably redundant to put.
<p><input type="submit" name="CONTINUE" value="CONTINUE" /></p>
</form>
Hopefully, this will work as you expect it to.
Try it with another browser to see if it might be from the browser's cache.
I'm pretty new to using wufoo forms and have been searching for a few days and can't quite find what I'm looking for.
I did find a number of articles about 'URL Modification' but not sure how to implement this for what I need.
We have a simple single wufoo form which is being used across 6 iterations of a client's domains (they are sector specific).
We want (in the email notification and response entry on wufoo) to record which site was used to complete the form (for analytical purposes).
In other words the email to the client should list:
Name: John Smith
Email: Johnsmith#mail.com
Phone: 555-123-1234
From: www.websiteversion1.com
The form is being integrated on Wordpress sites.
Any help would be appreciated!
You can copy the form HTML to your site's templates and modify the form, using PHP to fill in the value of the site url. I don't think WuFoo will automatically fill that field in for you.
First of all, in your WuFoo account forms manager, add a website (url) field and make it visible for admins only (this is a Wufoo option).
Then copy the generated form into your own template.
Now modify your form template so that it grabs the site URL and fills it in for the value of the website field where you want it.
Your form template might look something like this:
<form class="wufoo-form" id="form3" name="form3" accept-charset="UTF-8" autocomplete="off" enctype="multipart/form-data" method="post" novalidate action="#">
<div class="form-group">
<label for="Field1">Name</label>
<input id="Field1" name="Field1" type="text" placeholder="" value="">
</div>
<div class="form-group">
<label for="Field2">Email</label>
<input id="Field2" name="Field2" type="email" placeholder="" value="">
</div>
<div class="form-group">
<label for="Field3">Phone</label>
<input id="Field3" name="Field3" type="tel" placeholder="" value="">
</div>
<div class="form-group hidden">
<label for="Field4">From</label>
<input id="Field4" name="Field4" type="url" class="form-control" placeholder="" value="<?php esc_url( home_url() ); ?>">
</div>
<div class="form-group">
<button id="saveForm" name="saveForm" type="submit" name="submit" class="btn btn-primary btn-lg">Let's talk!</button>
<input type="hidden" id="idstamp" name="idstamp" value="***the_id_for_your_form_wufoo***" />
</div>
</form>
I am using the code below but am not sure how to add in two separate search forms that search for products ONLY in the parent category. Either product_parent_cat_floral or product_parent_cat_rentals
<?php
$classes = get_body_class();
if (in_array('product_parent_cat_rentals',$classes)) {
?>
//rentals search form would go here
<?php } else { ?>
//flowers search form would go here
<?php } ?>
Can I edit this search form to somehow make it only search for products within the appropiate parent class?
<form role="search" method="get" id="searchform" action="http://botanicaevents.com/rentals/">
<div>
<label class="screen-reader-text" for="s">Search for:</label>
<input type="text" value="" name="s" id="s" placeholder="Search for products" />
<input type="submit" id="searchsubmit" value="Search" />
<input type="hidden" name="post_type" value="product" />
</div>
</form>
I think you can simply use:
<input type="hidden" name="product_cat" value="rentals" />
so your search query becomes:
?s=some+search+string&post_type=product&product_cat=rentals
to additionally restrict the search within the rentals product category.
I need to incorporate a "Search" feature within my WordPress CMS site that I am currently developing and was hoping to attach this feature/plugin to the following piece of code and unsure how to do this in WordPress, i.e.:
<div id="search_box">
<form method="get" action="/search" id="form">
<input name="white_box" type="text" class="search" value="Search site" size="19" maxlength="80" id="white_box" onfocus="if (this.value=='Search site') this.value = ''"/>
<input name="submit" type="image" class="submit" value="submit" src="images/search_btn.jpg" />
</form>
</div>
I basically want to incorporate a "Search" feature on my site.
#Tonsils you may use any of below ready-to-use WordPress plugins depends on your requirement...
Use Relevanssi Plugin for Multilingual Support
http://wordpress.org/extend/plugins/relevanssi/
Use WPSearch for well behave custom Search
http://wordpress.org/extend/plugins/wpsearch/
Use Search-Everything for all type of Content Search
http://wordpress.org/extend/plugins/search-everything/
This a very basic WordPress search form. See the difference in the form action URL?
<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
<input type="text" size="14" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" class="s" />
<input type="submit" id="searchsubmit" value="<?php _e('GO'); ?>" />
</form>
i am picking up wordpress development and reading the book digging into wordpress. i have the code below in functions.php
<?php
add_action('admin_menu', 'addAmazonAffiliateOptions');
function addAmazonAffiliateOptions() {
add_options_page('Global Custom Fields', 'Global Custom Fields', 8, 'functions', 'editGlobalCustomFields');
}
function editGlobalCustomFields() { ?>
<div class="wrap">
<h2>Global Custom Fields</h2>
<form action="options.php" method="post">
<?php wp_nonce_field('update_options'); ?>
<p>
<label for="amazonId"><strong>Amazon ID</strong></label>
<input type="text" name="amazonId" value="<?php echo get_option('amazonId'); ?>" />
</p>
<p>
<input type="submit" name="submit" value="Update Options" />
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="amazonId" />
</p>
</form>
</div>
<?php }
when i try to save the options, i get
Your attempt to edit your settings has
failed.
how do i debug such things in wordpress?
I think you need to be using register_setting() - the WordPress core and API has changed quite considerably since that book was published.
Check out the codex on WordPress 2.7+ for adding plugin options pages.