From ea930dbbbcfb9ff5bc4460da1afa6c76e342257d Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 30 Jun 2014 10:50:17 -0400 Subject: [PATCH] update the for the form make radio button for the service_request add in js to disable undeeded options for this part. --- Toolkit/Contacts/ServiceRequest.php | 12 +++++++---- Toolkit/Contacts/templates/contactForm.html | 2 +- Toolkit/Page.php | 2 +- libjs/serviceRequestForm.js | 22 +++++++++++++++++++++ tmp/superfish.js | 2 +- 5 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 libjs/serviceRequestForm.js diff --git a/Toolkit/Contacts/ServiceRequest.php b/Toolkit/Contacts/ServiceRequest.php index b7b6d31..1dbfd8a 100755 --- a/Toolkit/Contacts/ServiceRequest.php +++ b/Toolkit/Contacts/ServiceRequest.php @@ -109,6 +109,8 @@ class Toolkit_Contacts_ServiceRequest $attributes = null, $trackSubmit = false ) { + $GLOBALS['bottomScripts'][] + = MEDIA_BASE_URL . 'libjs/serviceRequestForm.js'; parent::__construct( $pdo, $formName, @@ -276,11 +278,12 @@ class Toolkit_Contacts_ServiceRequest 'display' => 'Are you also requesting launch service?' ); $e[] = array( - 'type' => 'advcheckbox', + 'type' => 'radio', 'req' => false, - 'name' => 'service_request_yes', + 'name' => 'service_request', 'display' => '', 'opts' => 'Yes', + 'att' => 'Yes', 'val' => array(0, 1) ); $e[] = array( @@ -290,11 +293,12 @@ class Toolkit_Contacts_ServiceRequest 'display' => 'Anticipated Arrival Date' ); $e[] = array( - 'type' => 'advcheckbox', + 'type' => 'radio', 'req' => false, - 'name' => 'service_request_no', + 'name' => 'service_request', 'display' => '', 'opts' => 'No', + 'att' => 'No', 'val' => array(0, 1) ); $e[] = array( diff --git a/Toolkit/Contacts/templates/contactForm.html b/Toolkit/Contacts/templates/contactForm.html index bd06c3b..ee498cd 100644 --- a/Toolkit/Contacts/templates/contactForm.html +++ b/Toolkit/Contacts/templates/contactForm.html @@ -45,7 +45,7 @@ {elem.label:h}
{if:elem.error}{end:} {else:} - {if:elem.isName(#service_request#)} + {if:elem.isName(#service_request_yes#)} {if:elem.required}*{end:} {if:elem.error}
{end:} diff --git a/Toolkit/Page.php b/Toolkit/Page.php index 7b8ca21..ae07ec5 100755 --- a/Toolkit/Page.php +++ b/Toolkit/Page.php @@ -480,7 +480,7 @@ class Toolkit_Page && VIDEOS && $this->_catid == HOME_ID ) { - $this->_video(); + //$this->_video(); } // check if define for GLM_SEARCH is set diff --git a/libjs/serviceRequestForm.js b/libjs/serviceRequestForm.js new file mode 100644 index 0000000..4d2e065 --- /dev/null +++ b/libjs/serviceRequestForm.js @@ -0,0 +1,22 @@ +$(function(){ + $('input[name="service_request"]').click(function(){ + var serviceRequest = $(this).val(); + toggleGroups(serviceRequest); + }); + if ($('input[name="service_request"]')) { + var serviceRequest = $('input:checked[name="service_request"]').val(); + toggleGroups(serviceRequest); + } +}); + +function toggleGroups(serviceRequest){ + if (serviceRequest == 'Yes') { + $('input[name="delivery_date"]').prop('disabled', true); + $('input[name="completion_date"]').prop('disabled', true); + $('input[name="arrival_date"]').prop('disabled', false); + } else { + $('input[name="delivery_date"]').prop('disabled', false); + $('input[name="completion_date"]').prop('disabled', false); + $('input[name="arrival_date"]').prop('disabled', true); + } +} \ No newline at end of file diff --git a/tmp/superfish.js b/tmp/superfish.js index caac0f4..4c42813 100755 --- a/tmp/superfish.js +++ b/tmp/superfish.js @@ -232,7 +232,7 @@ hoverClass: 'sfHover', pathClass: 'overrideThisToUse', pathLevels: 1, - delay: 00, + delay: 8000, animation: {opacity: 'show'}, animationOut: {opacity: 'hide'}, speed: 'normal', -- 2.17.1