JavaScript Adding/Removing rows from a form. Resetting entire form adding and removing rows and columns in excel

These three functions all work on Chrome, but not IE or Firefox. The first functions adds a cloned row. The second function removes a cloned row. The third function resets the entire field. All three are well commented. Does anything obvious stick out to you? I am baffled.

Could it have something to do with the cloned rows using ID's and not classes?

$(function () {
    $('#btnAdd').click(function () {
        var num     = $('.clonedInput').length, // Checks to see how many "duplicatable" input fields we currently have
            newNum  = new Number(num + 1),      // The numeric ID of the new input field being added, increasing by 1 each time
            newElem = $('#CloneRow' + num).clone().attr({'id': 'CloneRow' + newNum}).addClass('addedRow').fadeIn('slow'); // create the new element via clone(), and manipulate it's ID using newNum value

    /*  This is where we manipulate the name/id values of the input inside the new, cloned element
        Below are examples of what forms elements you can clone, but not the only ones.
        There are 2 basic structures below: one for an H2, and one for form elements.
        To make more, you can copy the one for form elements and simply update the classes for its label and input.
        Keep in mind that the .val() method is what clears the element when it gets cloned. Radio and checkboxes need .val([]) instead of .val('').
    */
        // Hour - select
        newElem.find('.input_hr').attr('id', 'ID' + newNum + '_hour').attr('name', 'ID' + newNum + '_hour').val('0');

        // Minute - select
        newElem.find('.input_min').attr('id', 'ID' + newNum + '_min').attr('name', 'ID' + newNum + '_min').val('0');

        // Activiy - text
        newElem.find('.input_act').attr('id', 'ID' + newNum + '_act').attr('name', 'ID' + newNum + '_act').val('');

        // Category - select
        newElem.find('.input_cat').attr('id', 'ID' + newNum + '_cat').attr('name', 'ID' + newNum + '_cat').val('');

    // Insert the new element after the last "duplicatable" input field
        $('#CloneRow' + num).after(newElem);
        $('#ID' + newNum + '_title').focus();

    // Enable the "remove" button. This only shows once you have a duplicated section.
        $('#btnDel').attr('disabled', false);

    // Right now you can only add 13 sections, for a total of 15. Change '13' below to the max number of sections you want to allow.
        if (newNum == 20)
        $('#btnAdd').attr('disabled', true).prop('value', "That's all, folks!"); // value here updates the text in the 'add' button when the limit is reached
    });

    $('#btnDel').click(function () {
    // Confirmation dialog box. Works on all desktop browsers and iPhone.
        // if (confirm("Are you sure you wish to remove this section? This cannot be undone."))
            {
                var num = $('.clonedInput').length;
                // how many "duplicatable" input fields we currently have
                $('#CloneRow' + num).slideUp('slow', function () {$(this).remove();
                // if only one element remains, disable the "remove" button
                    if (num -1 === 1)
                $('#btnDel').attr('disabled', true);
                // enable the "add" button
                $('#btnAdd').attr('disabled', false).prop('value', "add section");});
            }
        return false; // Removes the last section you added
    });
    // Enable the "add" button
    $('#btnAdd').attr('disabled', false);
    // Disable the "remove" button
    $('#btnDel').attr('disabled', true);
    // Reset the entire form
    $('#btnRes').click( function () {
    {
    // Confirmation dialog box. Works on all desktop browsers and iPhone.
        if (confirm("Do you really want to reset the form? All data will be lost."))
            {
                 document.getElementById("BudgetFormEng").reset();
                 $('.addedRow').remove();
                 $('#output').empty();

                              };
        return false;
    };});

I am not receiving any errors from IE or Firefox.

Answer:1

I have been trying to draw a very basic rectangle using THREE.BufferGeometry(). Here is the code - var geometry = new THREE.BufferGeometry(); var material = new THREE.MeshBasicMaterial({color: 'rgb(...

I have been trying to draw a very basic rectangle using THREE.BufferGeometry(). Here is the code - var geometry = new THREE.BufferGeometry(); var material = new THREE.MeshBasicMaterial({color: 'rgb(...

I'm running into trouble trying to use Material Design Lite and AngularJS. After googling for a bit, I found another stack overflow post regarding a similar issue: Material Design Lite Integration ...

I'm running into trouble trying to use Material Design Lite and AngularJS. After googling for a bit, I found another stack overflow post regarding a similar issue: Material Design Lite Integration ...

  1. using material design icons
  2. using material design with react
  3. using material design with angular
  4. using material design in android
  5. using material design for web
  6. using material design in android studio
  7. using material design wpf
  8. using material design icons in react
  9. using material design in xamarin forms
  10. using material design in blazor
  11. using material design with django
  12. using material design with vue.js 2
  13. using material design
  14. using material design on ios
  15. using material design in angular 6
  16. using material design icons in angular
  17. using material design in sketch
  18. using material design for websites
  19. using material design in angular 4
  20. using material design css

I'm trying to send a javascript string variable from a javascript plugin of a program running in tomcat, to a php file hosted on apache (httpd on centOS) on the same physical machine. Trying to send ...

I'm trying to send a javascript string variable from a javascript plugin of a program running in tomcat, to a php file hosted on apache (httpd on centOS) on the same physical machine. Trying to send ...

  1. ajax send javascript array
  2. ajax send javascript variable to php
  3. ajax send javascript object
  4. ajax send javascript
  5. ajax send javascript array to php
  6. ajax send javascript object to php
  7. ajax send javascript json
  8. ajax javascript send data
  9. ajax javascript send data to php
  10. ajax javascript send file
  11. ajax javascript send parameters
  12. ajax javascript send request
  13. ajax send email javascript
  14. send ajax post javascript
  15. jquery ajax send javascript object
  16. jquery ajax send javascript object to php
  17. send data ajax post javascript
  18. send parameters ajax post javascript
  19. ajax send json data javascript
  20. ajax send form data javascript

How to convert these CocoaScript “braces notation” to JavaScript “dot notation” syntax? [fileManager createDirectoryAtPath: tmpFolder withIntermediateDirectories: true attributes: nil error: nil]; ...

How to convert these CocoaScript “braces notation” to JavaScript “dot notation” syntax? [fileManager createDirectoryAtPath: tmpFolder withIntermediateDirectories: true attributes: nil error: nil]; ...