From 347c0214388bae18616a9003adf84d7be509fa86 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sun, 20 Mar 2016 16:06:02 +0545 Subject: Reengineer Form_Button setAttribute As per what was done for https://github.com/pfsense/pfsense/pull/2765 - do it to the rest of them. Seems to work OK. --- src/usr/local/www/services_dhcp_edit.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/usr/local/www/services_dhcp_edit.php') diff --git a/src/usr/local/www/services_dhcp_edit.php b/src/usr/local/www/services_dhcp_edit.php index 7cc8b98..6ab36ce 100644 --- a/src/usr/local/www/services_dhcp_edit.php +++ b/src/usr/local/www/services_dhcp_edit.php @@ -439,7 +439,7 @@ $btnmymac = new Form_Button( 'fa-clone' ); -$btnmymac->removeClass('btn-primary')->addClass('btn-success btn-sm'); +$btnmymac->setAttribute('type','button')->removeClass('btn-primary')->addClass('btn-success btn-sm'); $group = new Form_Group('MAC controls'); $group->add($macaddress); @@ -597,7 +597,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Dynamic DNS', @@ -645,7 +645,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'NTP servers', @@ -681,7 +681,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'TFTP servers', @@ -738,8 +738,6 @@ events.push(function() { $('#btnadvdns').html(' ' + text); } - $('#btnadvdns').prop('type', 'button'); - $('#btnadvdns').click(function(event) { show_advdns(); }); @@ -775,8 +773,6 @@ events.push(function() { $('#btnadvntp').html(' ' + text); } - $('#btnadvntp').prop('type', 'button'); - $('#btnadvntp').click(function(event) { show_advntp(); }); @@ -811,15 +807,10 @@ events.push(function() { $('#btnadvtftp').html(' ' + text); } - $('#btnadvtftp').prop('type', 'button'); - $('#btnadvtftp').click(function(event) { show_advtftp(); }); - // Make the ‘Copy My MAC’ button a plain button, not a submit button - $("#btnmymac").prop('type','button'); - // On click, copy the hidden 'mymac' text to the 'mac' input $("#btnmymac").click(function() { $('#mac').val(''); -- cgit v1.1