خرید بک لینک

Vote count: 0

I have tried multiple options that I have found on SO and elsewhere for clearing form inputs, all listed below in the code, but nothing seems to work. Is there anything specific about this form that would determine which one I should use?

<template name="CompanyAdd">
    <div>
        <form class="form-inline">
            <div class="form-group">
                {{> inputAutocomplete settings=companySettings id="companyAdd" name="companyAdd" class="input-xlarge" autocomplete="off" placeholder="Add Company"}}
            </div>
            <button type="submit" class="btn btn-default company-add">Add</button>
        </form>
    </div>
</template


Template.CompanyAdd.events({
    'submit form': function(e) {
        e.preventDefault();

        var selection = $(e.target).find('[id=companyAdd]').val();

        var company = {
            ticker: selection
        };

        if(Companies.findOne({ticker:selection})) {
            console.log("Do nothing");
        } else {
            Meteor.call('companyAdd', company, function(error, result) {
            });
        }
        //event.target.reset();
        //e.target.reset();
        //target.text.value = '';
        //template.find("form").reset();
        //document.getElementById("companyAdd").reset();
    }
});

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 14 تير 1395 ساعت: 3:29

صفحه بندی