Jump to content

fliwire

Members
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

1 Neutral

About fliwire

  • Rank
    Jr. Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. this is like gutenberg https://codex.so/editor
  2. bernhard isnt InputfieldFile already upload file when form submit, why you call wireUpload again ?
  3. solved. forgot to add destinationPath to images2 field.
  4. why deleteAll() not working ? $u = user(); $u->of(false); $files = explode("|", $form->get("images2")->value); if($files) { $u->images->deleteAll(); // just want to one image, delete all images. - if delete this line images added. foreach($files as $file) { if($file && file_exists($upload_path . $file)){ $u->images->add($upload_path . $file); unlink($upload_path . $file); } } } $u->save(); // $u->images->deleteAll() not working so i used this. $u->images->delete($u->images->eq(0)); $u->save();
  5. calling $inputfield->getErrors(true) after form render solves this. another question if InputfieldFile in InputfieldFieldset form not get " enctype="multipart/form-data" " attr, this is bug ? $form = $modules->get("InputfieldForm"); $col1 = $modules->get("InputfieldFieldset"); $col1->importArray([ [ 'type' => 'InputfieldFile', 'name' => 'images', 'label' => 'Images', 'destinationPath' => $upload_path, 'extensions' => 'jpg jpeg gif png', 'maxFiles' => 3, 'maxFilesize' => 2*1024*1024, 'required' => 1 ], ]); $form->add($col1);
  6. Hi Soma using form api with this method but form errors always shows after first submit. How to clear after reload page ? <?php $form = $modules->get("InputfieldForm"); // create a text input $field = $modules->get("InputfieldText"); $field->label = "Name"; $field->attr('id+name', 'name'); $field->required = 1; $form->append($field); // append the field to the form // create email field $field = $modules->get("InputfieldEmail"); $field->label = "E-Mail"; $field->attr('id+name', 'email'); $field->required = 1; $form->append($field); // append the field // oh a submit button! $submit = $modules->get("InputfieldSubmit"); $submit->attr("value", "Subscribe"); $submit->attr("id+name", "submit"); $form->append($submit); if ($input->post->submit) { $form->processInput($input->post); } echo "<form action='./' method='post'>"; echo "<div class='row'>" . session()->CSRF()->renderInput() . "</div>"; echo "<div class='row'>" . $form->get('name')->render() . "</div>"; echo "<div class='row'>" . $form->get('name')->getErrors()[0] . "</div>"; echo "<div class='row'>" . $form->get('email')->render() . "</div>"; echo "<div class='row'>" . $form->get('email')->getErrors()[0] . "</div>"; echo "<div class='row'>" . $form->get('submit')->render() . "</div>"; echo "</form>";
  7. sorry for late answer:) why you not using anymore? another solution is form api ?
  8. installed this from gitlab but not working $modules->get('RockForms')->form; return null $modules->get('RockForms'); return object(ProcessWire\RockForms)#275 (1) { ["data"]=> array(3) { ["nettehny"]=> string(16) "comments message" ["uninstall"]=> string(0) "" ["submit_save_module"]=> string(6) "Submit" } }
  9. edited first code: $shipment = pages()->get($input->post->shipment_id);$shipment->of(false);$pages->delete($shipment, true); pw 3.0.98
  10. page has shipments ( repeater field ) with file field. $shipment = pages()->get($input->post->shipment_id); $shipment->of(false); $pages->delete($page, true); $page->of(false); $page->shipments->remove($pages->get($input->post->shipment_id)); $page->save(); both of work but give 500 error.. delete page with ajax. In console " Error: Call to a member function numChildren() on null (line 431 of \wire\core\PagesEditor.php) "
×
×
  • Create New...