Jump to content

Search the Community

Showing results for tags 'select field'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 2 results

  1. 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
  2. Hi guys, Am having an issue with a front-end form where page-fields via a select field are not getting updated. Could someone check that my syntax is correct? I'm not really sure why they're not matching up. The form part: <label for="edit_terms">Terms</label> <select name="edit_terms"> <?php foreach ($pages->find("template=payment_term") as $term) { ?> <option value="<?php echo $term->id; ?>"<?php if ($term->id == $page->invoice_terms->id) {echo " selected";} ?>><?php echo $term->title; ?></option> <?php } ?> </select> <label for="edit_status">Status</label> <select name="edit_status"> <?php foreach ($pages->find("template=invoice_status") as $status) { ?> <option value="<?php echo $status->id; ?>"><?php echo $status->title; ?></option> <?php } ?> </select> The editing page via API part: <?php $error = 0; $out = ""; // Form was submitted if ($input->post->estimate_edit_submit) { $page_name = $sanitizer->pageName($input->post->number); $p = $pages->find("template=estimate, name=$page_name")->remove($page); if (count($p)) { $error = 1; $out = "Sorry, that page name is already taken..."; } if ($error == 0) { $page->of(false); // $page->parent = $pages->get("/estimates"); // $page->template = "estimate"; $page->title = $sanitizer->name($input->post->number); $page->name = $sanitizer->pageName($input->post->number); $page->invoice_number = $sanitizer->name($input->post->number); $page->invoice_date = $sanitizer->text($input->post->date); $page->invoice_client = $sanitizer->text($input->post->client); $page->invoice_terms = $sanitizer->text($input->post->edit_terms); $page->invoice_status = $sanitizer->text($input->post->edit_status); $page->invoice_line->removeAll(); $total = 0; for ( $i=0;$i<count($input->post->invoice_billable);$i++) { ${'rp'.$i} = $page->invoice_line->getNew(); ${'rp'.$i}->invoice_billable_line = $input->post->invoice_billable[$i]; ${'rp'.$i}->invoice_billable_amount = $input->post->line_value[$i]; $total += $input->post->line_value[$i]; } $page->invoice_total = $total; $page->save(); $out = "Estimate saved successfully"; } } All the text fields are getting updated but all three select fields (client, terms and status) aren't updating. I have an almost identical template for create instead of edit and everything works fine. Been scratching my head now for a good few hours, can anyone see anything wrong with the way I'm using the API? Thanks.
  • Create New...