Jump to content

Is it Possible to Pass JavaScript to a Hook?


maddmac
 Share

Recommended Posts

Is is possible to pass JavaScript to a Hook? Looking to pass a value from a form select into a hook prior to the form being submitted. I realize the hook can be added when the form is processed but this is for a page lookup

 

$wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) {
  if($event->object->name == 'your_field_name') {
    $event->return = $event->pages->find('your selector here');
  }
});

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...