Hi,
I need help putting together a script to firstly set the value of a field using a drop down with custom labelling and secondly opening up specific fields if option 1 or option 2 is selected. I'm struggling to get the first part of the script to function (setting the value of a field manually by selecting an option from the drop down menu).
I'm no developer/programmer so completely amateur here :)
Fields used:
Custentity157
------------This is the question-----------------------------
<label for="programme-applied-for" class="spacer--top-l">What programme are you applying for</label>
<select name="programme-applied-for" id="programme-applied-for">
<option value="" disabled="" selected="" hidden="">Please select</option>
<option value="1">Expedition</option>
<option value="2">Re:Green</option>
</select>
--------------------This is the script-----------------------
<script>
$(document).ready(function(){
// On change of What Programme are you applying for: Set custentity157 (Application Submitted For field)
$('#programme-applied-for').change(function(){
var ApplicationSubmittedFor = $(this).val();
var $custentity157 = $('#custentity157');
var $display_if_RE:Green = $('.display-if-Re:Green');
var $display_if_Expedition = $('.display-if-Expedition');
if (ApplicationSubmittedFor == '1') { // Expedition
$custentity157.val('1');
}
else if (ApplicationSubmittedFor == '2') { // Re:Green
$custentity157.val('5');
}
}
});
</script>
Not sure what I'm doing wrong