New button added How to access with Jquery selector

New button added How to access with Jquery selector

jchyjchy Posts: 1Questions: 1Answers: 0

Hi I have added a button to replace the no matching records message so that a modal appears and a new record can be added to the database. However, the form does not clear from a previous submit, so i need to clear the form fields with jquery.

<button id='addRecord' class='btn btn-success btn-small active' data-toggle='modal' data-target='#myModal'><i class='icon-white icon-plus'></i> Add Record</button>

I am trying to access the selector with

    $('#addRecord').click(function () {
        $(':input', '#Form')
        //  .not(':button, :submit, :reset, :hidden')
            .val('')
            .removeAttr('checked')
            .removeAttr('selected');
    });

But it doesnt work. Is suspect the id="addRecord" is visible to the jquery.

Thanks for any help

Cheers

This discussion has been closed.