NIHVIVO-3445 template changes to use subjectName and propertyNameForDisplay; js change to ensure submit is disabled when there is no selected object in the autocomplete field

This commit is contained in:
tworrall 2011-12-07 17:03:57 +00:00
parent 1982bda0ee
commit 900d069ed5
3 changed files with 17 additions and 9 deletions

View file

@ -28,3 +28,6 @@ form.customForm h4 {
background: none;
color: #000;
}
.disabledSubmit {
cursor: default ! important;
}

View file

@ -185,6 +185,7 @@ var customForm = {
}
//Disable submit button until selection made
this.button.attr('disabled', 'disabled');
this.button.addClass('disabledSubmit'); // tlw
},
// Bind event listeners that persist over the life of the page. Event listeners
@ -378,6 +379,7 @@ var customForm = {
if(this.supportEdit) {
//On initialization in this mode, submit button is disabled
this.button.removeAttr('disabled');
this.button.removeClass('disabledSubmit'); // tlw
}
this.setButtonText('existing');
@ -411,7 +413,8 @@ var customForm = {
//Resetting so disable submit button again for object property autocomplete
if(this.supportEdit) {
//this.button.attr('disabled', 'disabled');
this.button.attr('disabled', 'disabled');
this.button.addClass('disabledSubmit');
}
}

View file

@ -23,8 +23,13 @@
<#assign selectedObjectUri = ""/>
</#if>
<#if editConfiguration.formTitle?contains("collaborator") >
<#assign formTitle = "Select an existing Collaborator for ${editConfiguration.subjectName}" />
<#else>
<#assign formTitle = editConfiguration.formTitle />
</#if>
<h2>${editConfiguration.formTitle}</h2>
<h2>${formTitle}</h2>
<#if editConfiguration.propertySelectFromExisting = true>
<#if rangeOptionsExist = true >
@ -34,11 +39,9 @@
<p>${editConfiguration.propertyPublicDescription}</p>
</#if>
<#---This section should become autocomplete instead-->
<p>
<label for="relatedIndLabel"> ${titleVerb} <span class='requiredHint'> *</span></label>
<label for="relatedIndLabel"> ${propertyNameForDisplay?capitalize} Name<span class='requiredHint'> *</span></label>
<input class="acSelector" size="50" type="text" id="relatedIndLabel" name="objectLabel" value="${objectLabel}" />
</p>
@ -68,7 +71,7 @@
<p> There are no entries in the system from which to select. </p>
</#if>
</#if>
<p>&nbsp;</p>
<#if editConfiguration.propertyOfferCreateNewOption = true>
<#include "defaultOfferCreateNewOptionForm.ftl">
@ -102,7 +105,6 @@
</script>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customForm.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customFormWithAutocomplete.css" />')}