Python Forum
How to add one more similar form by clicking on the current one using JS? Django
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add one more similar form by clicking on the current one using JS? Django
#1
It's simple. There is a form. It is necessary by clicking on it to add one more similar form. More precisely, not even by pressing, but when entering text, if there is such an opportunity in JS.

Here is the form itself.

<div class="field inline" id='specially'>
            <label for="specially" class="subhead">Special price from</label>
            {{ form.specially }}
            <span>kg</span>
            {{ form.number }}
            <span>usd</span>
</div>

<script>
$(document).ready(function() {    
  $('#specially').on('click', function(){    //here you need not click, but a function that determines text input.
    ???
  })
})
</script>
That is, the task is simple, you just need to add the same div. And there may be an infinite number of such divs. Since I don’t know JS yet, I can’t solve it myself (
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Django send email - email form Remek953 2 2,247 Sep-18-2020, 07:07 AM
Last Post: Remek953
  How to send notifications to gmail from contact form using Django and pushbullet Justchse 0 1,841 Sep-01-2020, 01:19 PM
Last Post: Justchse
  Django admin form with parent child tmmaersk 0 1,836 Apr-02-2020, 06:42 AM
Last Post: tmmaersk
  Send email to gmail after user fill up contact form and getting django database updat Man_from_India 0 2,071 Jan-22-2020, 03:59 PM
Last Post: Man_from_India
  Error clicking button with selenium julio2000 4 5,249 Jan-06-2020, 10:59 AM
Last Post: julio2000
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,246 Jun-30-2019, 12:21 AM
Last Post: scidam
  Django - Retrieve form data justantest 0 2,814 May-23-2019, 11:47 AM
Last Post: justantest
  popup login form in django uditvashisht 0 3,779 Jan-31-2018, 11:55 PM
Last Post: uditvashisht
  Django REST - input of some form fields is send twice to the backend ann 4 3,942 Jan-03-2018, 05:43 PM
Last Post: ann
  Display google recpatcha at the end of the form django-allauth app prithvi 2 4,095 Aug-08-2017, 09:19 PM
Last Post: prithvi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020