Hi,
Not sure about what you exactly want to do but you can create a link button which reloads its current page.
array(
'type' => 'submit',
'value' => 'This is a test',
'href' => '',
'attributes' => array(
'class' => 'button button-secondary unique-class-for-ajax-event',
),
)
Then you can add your JS script to trigger your own event assigning to the button, in the above case, using the class selector .unique-class-for-ajax-event.
Hope this helps.
Thread Starter
Aldo
(@ab_lu)
Thanks!
Is there a way to fire just a function instead of submitting the complete form?
Basically do my own PHP stuff, when the form is submitted?
There are load and content actions.
Is there something when the form is processed?
You can use the validation callbacks. In your extended class, add the validate() method.
Something like this,
public function validate( $aInputs, $aOldInputs, $oAdminPage, $aSubmitInfo ) {
// do your own stuff here
return $aInputs;
}
the forth parameter may be omitted if the form is not for admin pages such as meta boxes.