Search the Community
Showing results for tags 'select option'.
-
I want to select the first option in a page reference fieldtype when adding a new page (admin). Dont want to target the option id because the value may change. Field = booking_searchactivator_option Template = booking Page reference template = searchactivator My current code is only targeting the page id and not the value. So now it becomes id=1. Also i want to be able to change the value to the second value, third value / position in the dropdown. $wire->addHookAfter('Pages::added', function(HookEvent $event) { $page = $event->arguments(0); if (!$page->matches('template=booking')) return; $aktivator = 1; $page->setAndSave('booking_searchactivator_option', $aktivator); }); i also have another hook that removes already selected page references. $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { $page = $event->arguments(0); if($event->object->hasField == 'booking_searchactivator_option') { $pages = $event->wire()->pages; $already_selected_on_another_page = $pages->find("template=searchactivator, booking_searchactivator_option.owner.template=booking, booking_searchactivator_option.owner.id!=$page->id"); $event->return = $event->pages->find("template=searchactivator, sort=sort, id!=$already_selected_on_another_page"); } }); Please help!!
-
Is it possible to just show a list (page reference) but without any radio buttons? Or a drop down but the references is not selectable? The items needs to be references but the main thing is that its just a list. Please help!
- 2 replies
-
- reference page
- list
-
(and 2 more)
Tagged with:
-
Custom PHP code is available for use in PageReference field type. Is it possible to use custom php to generate the values for a Select Options FieldType?? What I'm to trying to achieve is to generate values for a options field from values for repeater in a grand parent's page (parent of parent page).
-
how can I make this with addHookAfter
- 1 reply
-
- hidden input
- select option
-
(and 1 more)
Tagged with:
-
Hello all, I have a contact-form with a select field as Subject. The select field is defined as: += subject1= THE FIRST Subject subject2= THE SECOND Subject Now I call the contact-fom from another page with a get parameter "subject" : http://processwiresite.com/contact/?subject="subject1" I have a Hook defined to process the form "onRender" and I have got the get parameter and sanitized it, etc. Now the question is: How can I select the option based on the get parameter ? Thank you in advance Raul