I am trying to make some fields mandatory for creating a bug in Bugzilla, from what I have read, the easiest way is by using JavaScript. The code I have used is shown below but doesnt seem to be working. My Javascript knowledge is pretty limited so i am presuming it is an error in my coding.
<script type="text/javascript">
<!--
function mandatory_text_check(){
if (this.form.short_desc.value == '')
{
alert('Please enter a summary sentence for this [% terms.bug %].');
return false;
}
else if (this.form.estimated_time.value == '0.0' && this.form.cf_issuetype.value == 'Task')
{
alert('Please enter an estimated time for completion of this task.');
return false;
}
else
return true;
}
-->
</script>
// Function is called from the commit button on the bottom of the page
<input type="submit" id="commit" value="Commit"
onclick="mandatory_text_check();">