dannyg280
asked on
Javascript: Find and Enable Submit Button in Table
I have a dynamically created table. Each row of the table includes form elements. It includes a drop down and a submit button.
The submit button is disabled by default and I want in enabled when I change the drop down.
The following function works great in making changes and calculation on the other data in the row, but I can't seem to get the SubmitButton to enable. Can someone tell me what I'm doing wrong?
The submit button is disabled by default and I want in enabled when I change the drop down.
The following function works great in making changes and calculation on the other data in the row, but I can't seem to get the SubmitButton to enable. Can someone tell me what I'm doing wrong?
// Chnages Op on rank change
$(".rank").change(function() {
var $rankop = this.value; // get Rank value
var $catrow = $(this).closest("tr"); // Find the row
var $catop1 = $catrow.find(".catop").text(); // Find cat Op
var $baseop = $catrow.find(".baseop").val(); // Find baseop
var $catop = ($rankop * $baseop); // Multiply ranking x op for new op
$catop =$catop.toFixed(2); // format to 2 decimal points
$catrow.find(".rankop").val($rankop); // change value of hidden field calcop for form submit
$catrow.find(".calcop").val($catop); // change value of hidden field calcop for form submit
$catrow.find(".catop").text($catop); // change text of catop cell to new op
$catrow.find(".SubmitButton").disabled = false; // Enable Submit Button. This is part that does not work
});
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect. Thank you
Open in new window
Use the prop() method