- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2021 07:05 AM
Hello All,
In UI Page i'm using the reference field and want to make mandatory. As it is used pop-up in incident form.
I have used required="required" mandatory="mandatory" required="true" required="required".
Even it is not working and lastly I used
HTML
<script>
document.getElementById('inputLabel').setAttribute("class", "required");
</script>
<style>
label.required::before {
content: '*';
margin-right: 4px;
color: red;
}
label.notrequired::before {
content: '*';
margin-right: 4px;
color: grey;
}
</style>
In Client script :
calling this function from reference field in HTML
function updateCost(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
gel('targetServiceCost').value = answer;
}
working but UI page is submitted with filling the reference field.
can anyone advice me
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2021 07:14 AM
Your client script looks like it's attempting to fill in the field value but not checking to see if it's empty before submitting, is your button calling updateCost or another function?
You need some sort of validation checking such as:
var costField = gel('targetServiceCost').value;
if (costField == ' ') {
gel('targetServiceCost').required = true;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2021 07:14 AM
Your client script looks like it's attempting to fill in the field value but not checking to see if it's empty before submitting, is your button calling updateCost or another function?
You need some sort of validation checking such as:
var costField = gel('targetServiceCost').value;
if (costField == ' ') {
gel('targetServiceCost').required = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2021 08:07 AM
Hello Ashley,
Thanks for response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2021 07:26 AM
Hi,
Refer to this link. This might help you.
Mark the comment as a correct answer and helpful if this helps to solve the problem.