WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have alot of custom meta boxes, and the user has to scroll to the top everytime he wants to save the meta info.

Is there a way to put submit buttons at every meta box that does that same as the update button?

share|improve this question
up vote 9 down vote accepted

Don't know if i agree with EarnestoDev answer which is more of an opinion then an answer based on facts and not true in all cases, since you can use jQuery to trigger the submit event when a different element is clicked, so just add this js code once

<script>
jQuery('.metabox_submit').click(function(e) {
    e.preventDefault();
    jQuery('#publish').click();
});
</script>

and in each metabox add:

<input type="submit" class="metabox_submit" value="Submit" />
share|improve this answer
    
Works great Thanks! – Talon May 7 '12 at 18:46

DON'T DO IT! There's reasons why FORMs have centralized submits. Because there's some processing done behind the screen and one button is safe. Having an extra button in all your Metaboxes will also take up more space.

The easier you make it for the user to press the button, the safer it is to bet he'll forget something. The more difficult it is to submit a post, the more sure you can be he'll review stuff properly.

One button = IMPORTANT. Many buttons = importance demotion.

share|improve this answer
2  
+1 and double that. If you need lots of fields, put them in one well thought meta box. – kaiser Oct 29 '11 at 16:33

This is the totally wrong approach to the problem (and this is really a UX question, not a coding one).

When you have many submit buttons, the UX convention is that each button will submit data grouped with it and not any other. This is not how wordpress post editor work as it has only one form and the metaboxes are just for visual effect, not a true separation of forms. Therefor you want only one submit button in order to not to confuse your users.

Now the problem with the button is that it scrolls with the page and gets out of the users field of view and he needs to scroll to see it, but the solution is not to litter the page with tens of buttons, but to either float the button (add some JS to change the css position to fixed when it gets out of view) or add a submit button in the admin bar and I can't find it right now but there used to be a plugin that does it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.