Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the enter key to submit a form during object creation defaults to "save & add another" #9437

Closed
amit177 opened this issue May 27, 2022 · 6 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@amit177
Copy link
Contributor

amit177 commented May 27, 2022

NetBox version

v3.2.3

Python version

3.9

Steps to Reproduce

  1. Install netbox
  2. Add a rack
  3. Add a new device to the rack
  4. Add an interface to the device and press enter instead of clicking on the Create button
  5. It will refresh the page instead of redirecting to redirect_url

Expected Behavior

The website should redirect to the link in the redirect_url parameter

Observed Behavior

The website redirects to the same page again as if "create & add another" was clicked

@amit177 amit177 added the type: bug A confirmed report of unexpected behavior in the application label May 27, 2022
@amit177
Copy link
Contributor Author

amit177 commented May 27, 2022

#7823
looks like it was resolved just for that form and not for the rest

@jeremystretch
Copy link
Member

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

@jeremystretch jeremystretch added the status: revisions needed This issue requires additional information to be actionable label May 31, 2022
@amit177
Copy link
Contributor Author

amit177 commented Jun 2, 2022

@jeremystretch
There are too many forms to list, I can't list all of them, but here are a few:

  • Add interface to device
  • Add IP to interface
  • Add inventory item to device
  • Add console port to device
  • Add power port to device

Basically, any form that has redirect_url in the URL and has more than one submit button (i.e, both Create and Create & Add Another or Save and Save & Continue Editing)

You can see the github issue I've mentioned in the previous reply for more information, you've resolved this in the past for only one form.

@jeremystretch
Copy link
Member

There are too many forms to list,

You only need to use one as an example. The key is to provide exact instructions that someone else can follow to confirm whether or not they can reproduce the bug.

@amit177
Copy link
Contributor Author

amit177 commented Jun 2, 2022

  1. Install netbox
  2. Add a rack
  3. Add a new device to the rack
  4. Add an interface to the device and press enter instead of clicking on the Create button
  5. It will refresh the page instead of redirecting to redirect_url

@jeremystretch jeremystretch removed the status: revisions needed This issue requires additional information to be actionable label Jun 3, 2022
@jeremystretch
Copy link
Member

jeremystretch commented Jul 19, 2022

  1. It will refresh the page instead of redirecting to redirect_url

This is not accurate. The form is being submitted using the "Create & Add Another" submission button, because it appears before the regular "Create" button. The interface is being created successfully (as indicated by the success message), and the user is redirected back to the interface creation page.

I'm not sure what the intent was re: #7823 but it should never be necessary to use Javascript to submit the form.

All we need to do to make the "create"/"save" button default is to reorder the buttons so that it appears first.

@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Jul 19, 2022
@jeremystretch jeremystretch self-assigned this Jul 19, 2022
@jeremystretch jeremystretch changed the title return_url is ignored on forms when clicking enter Using the enter key to submit a form during object creation defaults to "save & add another" Jul 19, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants