Bugzilla でバグを作成するためにいくつかのフィールドを必須にしようとしています。私が読んだことによると、最も簡単な方法は JavaScript を使用することです。私が使用したコードを以下に示しますが、機能していないようです。私の Javascript の知識はかなり限られているため、コーディングのエラーであると推測しています。
<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();">