Feat(AddSaleLineButton): Sale Line Button

This commit is contained in:
Rodia 2024-07-13 11:01:11 -05:00 committed by Mono Mono
parent cb84371f4b
commit b70a0b73c3
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
document.addEventListener('DOMContentLoaded', function(){ document.addEventListener('DOMContentLoaded', function(){
var button = document.getElementById('add_line'); var button = document.getElementById('add_line');
var formContainer = document.getElementById('formset-container'); var formContainer = document.getElementById('formset-container');
var totalForms = document.getElementById('id_form-TOTAL_FORMS'); var totalForms = document.getElementById('id_saleline_set-TOTAL_FORMS');
button.addEventListener('click', function(){ button.addEventListener('click', function(){
// Clonar un formulario vacío // Clonar un formulario vacío
var newForm = formContainer.querySelector('.form-container').cloneNode(true); var newForm = formContainer.querySelector('.form-container').cloneNode(true);

View File

@ -13,7 +13,7 @@
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
<button id="add_line">Añadir Linea</button> <button id="add_line" type="button" onclick="add_line">Añadir Linea</button>
<br/><button name="form" type="submit" >Comprar</button> <br/><button name="form" type="submit" >Comprar</button>
<script src="{% static 'js/add_line.js' %}"></script> <script src="{% static 'js/add_line.js' %}"></script>
</form> </form>