I want to provide 2 buttons in one form. User click either button can submit the form but do different jobs-- one button is to import checked files, another button is to create fiels. Will this confuse Wordpress?
closed as off topic by Brian Fegter, Rarst♦ Oct 2 '12 at 21:30
Questions on WordPress Development Stack Exchange are expected to relate to WordPress within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.
If you're placing a button in a meta box, it is included within the FORM tags for a post. A simple answer is no, you shouldn't place a submit button in the post form. However, nstead of using a normal
A click won't process as a submit action, it will just click. You obviously will need to bind the click event to however you're importing your file list. If you're not using AJAX, you should. Check out this article on how to use AJAX in WordPress.
Having a submit button within the form will post to post.php and certainly will have unwanted effects, namely losing any changed data within the post form.