Re: How to add form field dynamically?

2018-09-26 Thread Joel
Describe what you mean by add dynamically. If blocks in templates allow a
great deal of flexibility.

On Wed 26 Sep, 2018, 5:16 PM Django Lover,  wrote:

> I am creating a model form, i need to add a field dynamically can you
> please give me the solution by using your sharp intelligence?
>
> [image: synm.png]
>
>
> Product/service are coming from the model field.they are not static.
>
>
> Add New is unlimited.
>
>
>
> please help
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/f144ae51-a036-4aeb-94d5-d058a4067489%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAA%3Diw__1LTyN4jt0R41HRudNFMUwzss%2BL9AdwLQcs8A6Sf6Png%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add form field dynamically?

2018-09-26 Thread Django Lover
Hi joel Thank for response.

*I want something like this-*

[image: form.png] 









1- when I click on *add row* button a new Row (*No-2)* will 
create dynamically.
2- In the select *product/service* its an options dropdown. the option 
should have related *model data*(from table product and service list)
3-  when i save all records in the dynamic field save to the database.


I hope it clear to you. but if you need more information please let me know 
i am glad to discuss with you.

:)

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/768d0fb2-4155-40c3-b0fc-fc4dbd2ad553%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add form field dynamically?

2018-09-26 Thread Joel
I don't think django alone can help you here. You need to do that with
JavaScript.

On Wed 26 Sep, 2018, 6:01 PM Django Lover,  wrote:

> Hi joel Thank for response.
>
> *I want something like this-*
>
> [image: form.png]
>
>
>
>
>
>
>
>
>
> 1- when I click on *add row* button a new Row (*No-2)* will
> create dynamically.
> 2- In the select *product/service* its an options dropdown. the option
> should have related *model data*(from table product and service list)
> 3-  when i save all records in the dynamic field save to the database.
>
>
> I hope it clear to you. but if you need more information please let me
> know i am glad to discuss with you.
>
> :)
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/768d0fb2-4155-40c3-b0fc-fc4dbd2ad553%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAA%3Diw_9EXkE7h9rU%3Dwyy02AZcM2rKnAFZ2Bn_hKRQP1Q4wS2MA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add form field dynamically?

2018-09-26 Thread Django Lover
Then What is the solution please let HELP ME?? I know that it will done by 
Jquery but how? I dont Know



On Wednesday, September 26, 2018 at 6:14:07 PM UTC+5:30, Joel wrote:
>
> I don't think django alone can help you here. You need to do that with 
> JavaScript.
>
> On Wed 26 Sep, 2018, 6:01 PM Django Lover,  > wrote:
>
>> Hi joel Thank for response.
>>
>> *I want something like this-*
>>
>> [image: form.png]
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 1- when I click on *add row* button a new Row (*No-2)* will 
>> create dynamically.
>> 2- In the select *product/service* its an options dropdown. the option 
>> should have related *model data*(from table product and service list)
>> 3-  when i save all records in the dynamic field save to the database.
>>
>>
>> I hope it clear to you. but if you need more information please let me 
>> know i am glad to discuss with you.
>>
>> :)
>>
>> -- 
>> 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/768d0fb2-4155-40c3-b0fc-fc4dbd2ad553%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/2140d58d-fc8b-4dcf-9acd-d965afa46cbc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add form field dynamically?

2018-09-26 Thread Joel Mathew
You would use jquery to create the button using the $(selector).html(code).
Since this doesnt fall within the scope of this django group, I wont
elaborate. If you know basic javascript and jquery, it should be easy.



On Wed, 26 Sep 2018 at 19:25, Django Lover  wrote:

> Then What is the solution please let HELP ME?? I know that it will done by
> Jquery but how? I dont Know
>
>
>
> On Wednesday, September 26, 2018 at 6:14:07 PM UTC+5:30, Joel wrote:
>>
>> I don't think django alone can help you here. You need to do that with
>> JavaScript.
>>
>> On Wed 26 Sep, 2018, 6:01 PM Django Lover,  wrote:
>>
>>> Hi joel Thank for response.
>>>
>>> *I want something like this-*
>>>
>>> [image: form.png]
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> 1- when I click on *add row* button a new Row (*No-2)* will
>>> create dynamically.
>>> 2- In the select *product/service* its an options dropdown. the option
>>> should have related *model data*(from table product and service list)
>>> 3-  when i save all records in the dynamic field save to the database.
>>>
>>>
>>> I hope it clear to you. but if you need more information please let me
>>> know i am glad to discuss with you.
>>>
>>> :)
>>>
>>> --
>>> 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/768d0fb2-4155-40c3-b0fc-fc4dbd2ad553%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/2140d58d-fc8b-4dcf-9acd-d965afa46cbc%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAA%3Diw_8%3D6wQ7kg0TshMDHEBnD7hPfRq65nERkOMO%3D4XoDZ%2BjAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add form field dynamically?

2018-09-26 Thread matteo gassend (LanguageMatt)
You could always mix jquery with formsets
Il 26 set 2018, 18:02 +0200, Joel Mathew , ha scritto:
> You would use jquery to create the button using the $(selector).html(code).
> Since this doesnt fall within the scope of this django group, I wont 
> elaborate. If you know basic javascript and jquery, it should be easy.
>
>
>
> > On Wed, 26 Sep 2018 at 19:25, Django Lover  wrote:
> > > Then What is the solution please let HELP ME?? I know that it will done 
> > > by Jquery but how? I dont Know
> > >
> > >
> > >
> > > On Wednesday, September 26, 2018 at 6:14:07 PM UTC+5:30, Joel wrote:
> > > > I don't think django alone can help you here. You need to do that with 
> > > > JavaScript.
> > > >
> > > > > On Wed 26 Sep, 2018, 6:01 PM Django Lover,  
> > > > > wrote:
> > > > > > Hi joel Thank for response.
> > > > > >
> > > > > > I want something like this-
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > 1- when I click on add row button a new Row (No-2) will create 
> > > > > > dynamically.
> > > > > > 2- In the select product/service its an options dropdown. the 
> > > > > > option should have related model data(from table product and 
> > > > > > service list)
> > > > > > 3-  when i save all records in the dynamic field save to the 
> > > > > > database.
> > > > > >
> > > > > >
> > > > > > I hope it clear to you. but if you need more information please let 
> > > > > > me know i am glad to discuss with you.
> > > > > >
> > > > > > :)
> > > > > >
> > > > > > --
> > > > > > 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/768d0fb2-4155-40c3-b0fc-fc4dbd2ad553%40googlegroups.com.
> > > > > > For more options, visit https://groups.google.com/d/optout.
> > > --
> > > 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+unsubscr...@googlegroups.com.
> > > To post to this group, send email to django-users@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/2140d58d-fc8b-4dcf-9acd-d965afa46cbc%40googlegroups.com.
> > > For more options, visit https://groups.google.com/d/optout.
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/CAA%3Diw_8%3D6wQ7kg0TshMDHEBnD7hPfRq65nERkOMO%3D4XoDZ%2BjAg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/ff9add3b-5d44-42a5-b8b2-cdf43476acdb%40Spark.
For more options, visit https://groups.google.com/d/optout.


Re: How to add form field dynamically?

2018-09-26 Thread Kasper Laudrup

Hi Django Lover,

On 26/09/2018 15.55, Django Lover wrote:
Then What is the solution please let HELP ME?? I know that it will done 
by Jquery but how? I dont Know





The first hit I got on a search for "jquery dynamic form" sent me to 
this page:


https://www.jqueryscript.net/tags.php?/dynamic%20form/

Looks like something like this:

https://www.jqueryscript.net/form/Dynamic-Form-Creation-Deletion.html

is exactly what you need?

Of course you still need to handle the submitted form on the server 
(Django) side and you might not be able to use most of Djangos builtin 
form handling functionality, but someone else definitely knows more 
about that than me.


Kind regards,

Kasper Laudrup

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/2b7a307d-d338-dc0e-f738-770f1245805c%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Re: How to add form field dynamically?

2018-10-01 Thread Devender Kumar
Hi,
I have been to this type of problem.
There two solutions to this
You have to made this using java script for front end and for database or
backend.
For front end make a counter which will create a form fileds with
name="columnname$countet" sir that the post request you can fetch all the
detail in the backend
You can have two approaches for backend.
One to make a table and for each add store a reference two which thing it
belongs  to
Like there is one question and there can be any no of ans two that
question. In senerios like this make a question model and in answer model
with foreign key to question table in this senerio u will have one question
can have any no of answer

Second approach which I followed is to store the form data to JSON.
Enjoy
Thanks


On Wed 26 Sep, 2018, 11:28 PM Kasper Laudrup,  wrote:

> Hi Django Lover,
>
> On 26/09/2018 15.55, Django Lover wrote:
> > Then What is the solution please let HELP ME?? I know that it will done
> > by Jquery but how? I dont Know
> >
> >
>
> The first hit I got on a search for "jquery dynamic form" sent me to
> this page:
>
> https://www.jqueryscript.net/tags.php?/dynamic%20form/
>
> Looks like something like this:
>
> https://www.jqueryscript.net/form/Dynamic-Form-Creation-Deletion.html
>
> is exactly what you need?
>
> Of course you still need to handle the submitted form on the server
> (Django) side and you might not be able to use most of Djangos builtin
> form handling functionality, but someone else definitely knows more
> about that than me.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/2b7a307d-d338-dc0e-f738-770f1245805c%40stacktrace.dk
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CALZ%3DbEKg0eOAXc4N%3D%2Bv_%3D-XcGjEeeo0ZOD-N0FNTxFgGjY5RBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add form field dynamically?

2018-10-01 Thread heriberto ochoa
maybe with formset and jquery:
https://docs.djangoproject.com/en/2.1/topics/forms/formsets/

El miércoles, 26 de septiembre de 2018, 5:46:14 (UTC-6), Django Lover 
escribió:
>
> I am creating a model form, i need to add a field dynamically can you 
> please give me the solution by using your sharp intelligence? 
>
> [image: synm.png]
>
>
> Product/service are coming from the model field.they are not static.
>
>
> Add New is unlimited.
>
>
>
> please help
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/bf83fdaa-c01b-462c-a98d-5bf0741096b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.