Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm making an admin page for my plugin and I'd like to make a text link designed like the form button of admin pages.

I tried this but didn't work well.

<a href="" cless="button-primary" style="line-height: 2em; border-color: #298CBA; font-weight: bold; color: white; background: #21759B url(../images/button-grad.png) repeat-x scroll left top; text-shadow: rgba(0, 0, 0, 0.3) 0 -1px 0;">Submit</a>

I also tried just putting a submit button, expecting that the page goes to the url in the action attribute.

<form action="$url" target="_self">
    <input type="submit" class="button-primary" value="Submit" />
</form>

Does anybody know how?

share|improve this question
1  
The main issue is probably the misspelling of class, you have cless... –  Eric Holmes Oct 3 '13 at 19:39
add comment

1 Answer 1

This worked,

<?php 
$pageslug = 'the-plugin-option-page-slug';
?>
    <form method="post" action="?page=<?php echo $pageslug; ?>&tab=2">
        <input type="submit" class="button-primary" value="Submit" />       
    </form>
<?php

I have tabbed option pages and the button just works like a link to the tab 2 page without submitting anything.

share|improve this answer
add comment

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.