You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm updating the last of my plugins for Craft 5 and I'm seeing a strange difference in behavior.
I tried a bunch of syntaxes and different forms but to no avail - hoping you can point me in the right direction :)
My form looks like this:
<formsprigs-method="post"s-action="site/cp/save" >
<p>
<strong>{{ name ?? "Name not defined" }}</strong><br>
<strong>{{ option ?? "Option not defined" }}</strong><br>
</p>
<div>
<inputid="name"type="text"name="name"value="{{ name ?? '' }}">
</div>
<div>
<selectsprigname="option"id="option">
<optionvalue="1">1</option>
<optionvalue="2">2</option>
<optionvalue="3">3</option>
</select>
</div>
<buttontype="submit">Submit</button>
</form>
Filling out the name, skipping the select and clicking submit, I see all form fields the request my controller receives
But when I fill out the name, choose on option from the select field, the fields don't get submitted back to my controller, not even the select in question.
I have the same setup in my plugin and in Craft 4 this seems to work - so I'm not sure what the issue is.
Plugin Version
3.5.2
Craft CMS Version
5.57
PHP Version
8.2
The text was updated successfully, but these errors were encountered:
But when I fill out the name, choose on option from the select field, the fields don't get submitted back to my controller, not even the select in question.
Are you sure? Can you show me the request URL without the fields in the query string params?
That might not have been the best explanation of what I'm seeing - let me try again :)
On Craft 4, the form reloads/refreshes when changing the select - but it doesn't post to my controller unless I click the submit button myself. https://share.cleanshot.com/9K1tJsZH
But on Craft 5, the same form posts the controller straight away and then doesn't include any of the form fields https://share.cleanshot.com/yxcYXFhW
The forms themselves and the controller are exactly the same for both versions.
So it’s difficult to help you, seeing so little, but one thing I notice is that the 500 error appears to be the result of a POST request. Is that intentional? If you can send me some test code that I can use to replicate the issue then I’m sure I’ll be able to track it down. Right now my suspicion is that the forms are set up differently on your end.
Bug Report
I'm updating the last of my plugins for Craft 5 and I'm seeing a strange difference in behavior.
I tried a bunch of syntaxes and different forms but to no avail - hoping you can point me in the right direction :)
My form looks like this:
I have the same setup in my plugin and in Craft 4 this seems to work - so I'm not sure what the issue is.
Plugin Version
3.5.2
Craft CMS Version
5.57
PHP Version
8.2
The text was updated successfully, but these errors were encountered: