make a button element outside <form> be on the right side of another element inside <form>

27 views
Skip to first unread message

fábio andrews rocha marques

unread,
Sep 28, 2017, 6:56:57 PM9/28/17
to Django users
In my template, I have a form. This form has a lot of textfields and a submit button. There's another button, lets name it "?", that displays a popup window whenever it's clicked.
I want the "?" button to be on the right side of one of the textfields on my form. The problem is: since the form has an action associated with it, if i put the button inside the form, whenever the user clicks on it, the system computes it's action as if the submit button was clicked too... I don't want this to happen. 

How can i position my "?" button to the right of a component which is inside a <form> even though my "?" button is outside the <form>?

Vijay Khemlani

unread,
Sep 28, 2017, 8:19:01 PM9/28/17
to django...@googlegroups.com
An input with type "button" instead of "submit" should not trigger the form submit.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/96716dc0-19d9-46e0-9c04-f0e644c57b8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

fábio andrews rocha marques

unread,
Sep 29, 2017, 8:37:13 AM9/29/17
to Django users
unfortunally, it does trigger. I have an input and a button. The button is "?" and the input is my submit form button


On Thursday, September 28, 2017 at 9:19:01 PM UTC-3, Vijay Khemlani wrote:
An input with type "button" instead of "submit" should not trigger the form submit.
On Thu, Sep 28, 2017 at 7:56 PM, fábio andrews rocha marques <fabioandrews...@gmail.com> wrote:
In my template, I have a form. This form has a lot of textfields and a submit button. There's another button, lets name it "?", that displays a popup window whenever it's clicked.
I want the "?" button to be on the right side of one of the textfields on my form. The problem is: since the form has an action associated with it, if i put the button inside the form, whenever the user clicks on it, the system computes it's action as if the submit button was clicked too... I don't want this to happen. 

How can i position my "?" button to the right of a component which is inside a <form> even though my "?" button is outside the <form>?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

Constantine Covtushenko

unread,
Sep 29, 2017, 10:20:13 PM9/29/17
to django...@googlegroups.com
Dear Fabio,

Can you please provide html of your button here?

Thank you,

Regards,
Constantine C.

To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.



--
Sincerely yours,
Constantine C
Reply all
Reply to author
Forward
0 new messages