vitro/webapp/web/templates/edit/specific/ontology_retry.jsp

62 lines
2.4 KiB
Text
Raw Normal View History

<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
2012-08-29 19:51:27 +00:00
<tr class="editformcell">
<td valign="bottom" colspan="3">
<b>Ontology name</b><br/>
<input type="text" name="Name" value="<form:value name="Name"/>" size="40" maxlength="120" />
</td>
</tr>
<tr class="editformcell">
<td valign="bottom" colspan="3">
2012-08-29 19:51:27 +00:00
<b>Namespace URI*</b>&nbsp;<span class="note"> (must begin with http:// or https://)</span><br/>
<c:choose>
<c:when test="${_action eq 'update'}">
<i>Change via the "change URI" button on previous screen</i><br/>
<input disabled="disabled" type="text" name="URI" value="<form:value name="URI"/>" size="50" maxlength="240" />
</c:when>
<c:otherwise>
<input type="text" name="URI" value="<form:value name="URI"/>" size="50" maxlength="240" />
</c:otherwise>
</c:choose>
<c:set var="URIError"><form:error name="URI"/></c:set>
<c:if test="${!empty URIError}">
<span class="notice"><c:out value="${URIError}"/></span>
2012-08-29 19:51:27 +00:00
</c:if>
</td>
</tr>
<tr class="editformcell">
<td valign="bottom" colspan="3">
<b>Namespace prefix</b><br/>
<input type="text" name="Prefix" value="<form:value name="Prefix"/>" size="8" maxlength="25" />
<c:set var="PrefixError"><form:error name="Prefix"/></c:set>
<c:if test="${!empty PrefixError}">
<span class="notice"><c:out value="${PrefixError}"/></span>
</c:if>
</td>
</tr>
2012-08-29 19:51:27 +00:00
<script type="text/javascript">
2012-09-07 17:10:04 +00:00
$(document).ready(function() {
var source = "";
$('input#primaryAction').click(function() {
source = "submit";
});
2012-08-29 19:51:27 +00:00
$('form#editForm').submit(function() {
2012-09-07 17:10:04 +00:00
if (source == "submit") {
var str = $('input[name=URI]').val();
if ( str.indexOf('http://') >= 0 || str.indexOf('https://') >= 0 ) {
return true;
}
else {
alert('The Namespace URI must begin with either http:// \n\n or https://');
$('input[name=URI]').focus();
source = "";
return false;
}
2012-08-29 19:51:27 +00:00
}
});
2012-09-07 17:10:04 +00:00
});
2012-08-29 19:51:27 +00:00
</script>