how to send data from form site page

23 views
Skip to first unread message

Gear Crew

unread,
Nov 22, 2018, 9:47:34 AM11/22/18
to Django users
how to send data from form site page that has html form to model without using form model because I want to use HTML elements instead of elements in form model

Jani Tiainen

unread,
Nov 22, 2018, 9:53:54 AM11/22/18
to django...@googlegroups.com
Hi.

I've really hard time to understand what you want to achieve. Could you please give an example what you're after?

Gear Crew <mohamed.k...@gmail.com> kirjoitti to 22. marrask. 2018 klo 16.48:
how to send data from form site page that has html form to model without using form model because I want to use HTML elements instead of elements in form model

--
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.
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/3d21f7db-8fa4-416b-b5ca-f0f111425100%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gear Crew

unread,
Nov 22, 2018, 10:18:29 AM11/22/18
to Django users
I want to edit style for form model like changing in default HTML tags 

Thiago Oliveira

unread,
Nov 22, 2018, 10:49:11 AM11/22/18
to django...@googlegroups.com
I don't know if i understand, 

but if you make html html  and put tag name with same name that form field...  you can get the information

like  from = MyForm(request.POST)

because, the tag name always  send to back-end with the value of field.... 

     

Jani Tiainen

unread,
Nov 22, 2018, 11:53:41 AM11/22/18
to django...@googlegroups.com
Hi,

If I understood correctly you want to render form with plain HTML. That is completely possible and it's not even hard.

You just can do <input type="text" name="some_field_name"> and it will work

Only important thing is to match "some_field_name" with field name in the django form. You still should Django form in a view to do very important thing that it's actually meant for - to validate and coerce user input in correct form. Also you might want to render field and form errors (forms do provide simple accessors for them) from the form itself. As well as initial/current values so you don't show empty form everytime for user for example when your form fails to validate.






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


--
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

Jason

unread,
Nov 22, 2018, 10:40:59 PM11/22/18
to Django users
https://stackoverflow.com/help/how-to-ask

how to ask a good question is one of the most valuable skills you can learn.  if you do so, you won't have several people asking for more clarifications to broad, imprecise queries and struggling to give any meaningful help
Reply all
Reply to author
Forward
0 new messages