ncsu-stars / Stars-CMS

A CMS written in Django for the STARS SLC at NCSU
http://research.csc.ncsu.edu/stars
BSD 2-Clause "Simplified" License
7 stars 2 forks source link

Cancelling member/project edit forms causes submission #32

Closed mdraelos closed 12 years ago

mdraelos commented 12 years ago

Bugfix

omarestrella commented 12 years ago
mdraelos commented 12 years ago

Does this fix the issue with edit_profile.html as well?

Also, I may look into properly handling the cancel button server-side.

omarestrella commented 12 years ago

Yes, that issue with the cancel button on the edit profile page is fixed.

The only case where the cancel would fail would be if Javascript is disabled.

mdraelos commented 12 years ago

Commit 1b07deb7d197aa556514f05fd1036d8406c13dbe doesn't touch edit_profile.html, and my test indicates that the issue persists for profile edits.

Yes, but the cancel button is still incorrectly coded as a submit button. How about this: Add the attribute type="button" to the cancel button so clicking it doesn't submit the form. The JavaScript will handle the redirection, and there is no possibility that clicking the cancel button would be incorrectly interpreted server-side.

omarestrella commented 12 years ago

You are right, I mixed up edit_project.html and edit_profile.html, sorry about that. I added another commit 38f22aa538700c09cfaea2b59fc2f0d107a437f6. I added the type="button" to all the buttons so they wouldnt submit the form.

mdraelos commented 12 years ago

38f22aa538700c09cfaea2b59fc2f0d107a437f6 did the trick! We should note to set type="button" going forward for non-submit buttons.