Skip to content

Cannot submit form to add new model #49

@wotta

Description

@wotta

Describe the bug
I tried creating a new "model" using three inputs that are "wired" to their respective public variables in the livewire component class.
On the form I added "wire:submit="storeShop" which I would expect trigger the storeShop function that will create a new "Shop" model, but it didn't work.

I made sure to add the quickstart code to the my project in the same "Component" and "view" and those do work.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://gist.github.com/wotta/0c2efa1153052184186833695685b33b
  2. Add those files to a fresh project
  3. Create a Shop model with the fields that I added.
  4. Register the livewire route.
  5. Go to 'project.test/shops'
  6. Fill the form
  7. See that the page gets refreshed and the url is : project.test/shops?

Expected behavior
I expected that the form wouldn't refresh the page but submit the function with the data that was filled in the input fields.

Screenshots
https://monosnap.com/file/s8qQqgmz9PgBokAzFylPrj3bjBkNXp

Desktop (please complete the following information):

  • OS: MacOS 10.14.3 Beta (18D39a)
  • Vivaldi | 2.6.1566.49 (Stable channel) (64-bit)
  • Revision | d126d99a97ff62b9503aa8f44003e70741c4d90f
  • JavaScript | V8 7.5.288.30
  • Flash | 32.0.0.223 /Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin
  • User Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.145 Safari/537.36 Vivaldi/2.6.1566.49

I hope somebody can help me.

Best regards,
Wouter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions