Form in WordPress : 404
You’re probably using an input field that contains name=”name”. A lot of generic words are used by WordPress itself (incl. name, so a best practise is to always prefix_ your fields, like name=”prefix_name”.
You’re probably using an input field that contains name=”name”. A lot of generic words are used by WordPress itself (incl. name, so a best practise is to always prefix_ your fields, like name=”prefix_name”.
The Save buttons have a class widget-control-save, and this is hooked up to wpWidgets.save(). So you either have to call wpWidgets.save(), or (probably easier) trigger a click event on the Save button.
you can add an hidden filed to your search form and include a different template based on that: <form role=”search” method=”get” id=”searchsupport” action=”https://wordpress.stackexchange.com/”> <label class=”screen-reader-text” for=”s”>Search for:</label> <input type=”text” onfocus=”if (this.value == ‘Search’) {this.value=””;}” onblur=”if (this.value == ”) {this.value=”search”;}” id=”s” name=”s” value=”search” class=”search-form round”> <input type=”hidden” id=”searchsubmit”> <!– this is the magic field —> <input … Read more
WordPress has a great little function built in for handling selections. <option <?php selected(‘value1’, ‘value2′);?> value=”foo”>Bar</option> You can also check out these form handling functions: checked() http://codex.wordpress.org/Function_Reference/checked disabled() http://codex.wordpress.org/Function_Reference/disabled Your HTML syntax is wrong as well. Per W3C, ‘value’ is not an attribute of the select tag. The value of a select is defined in … Read more
For something like this you might consider adding an ‘action’; which appear when you hover other the item. The following code is not complete, and hasn’t been tested – but should get you on the right track. Add the action First, to add the action link, use the tag_row_actions hook. (Keep in mind a function … Read more
WordPress has a pretty flexible way of handling custom data, and it stores it in a table called wp_postmeta (assuming default wp_ prefix). The only catch is that it assumes that it will somehow be related to a certain post, which I’m not sure you actually want to do. It’s very simple to use (see … Read more
If you leave the action empty, the form will submit to the same page. So just do this: <form action=” method=’get’>”;
I am not sure if this helpful or not. As s_ha_dum said, you should post how you are processing the submitted data and sending to db. But for starters, you might look at escaping the outputted data in the form: <input style=”width:100%” type=”text” name=”dataHow to sanitize user input?” id=”title” value=”<?php $title = get_option(‘data_test’); echo esc_attr($title[‘title’]); … Read more
When working with AJAX and Forms in WordPress I like to code in the ajax action to the form so serialize works out of the box. Actually I wrote an article on this last year: https://webdevstudios.com/2015/02/12/handling-ajax-in-wordpress/ But, you’re here for answers, not a blog article, so here’s the brief part of it. You have three … Read more
You said your original code is working. I think you should try using wp_redirect but you can’t output any HTML/Headers for that. Untested, but try the following: Note: intentionally missed out the html/body tags… <?php require_once(‘../../../wp-config.php’); require_once(‘../../../wp-load.php’); global $wpdb; $feedurl=$_POST[‘scimp_feed_url’]; $showcategory=$_POST[‘scimp_show_category’]; $table_name = $wpdb->prefix . ‘scimp’; $wpdb->insert( $table_name, array(‘feedurl’ => $feedurl, ‘category’ => $showcategory)); wp_redirect( … Read more