ASNMTAP
view release on metacpan or search on metacpan
applications/htmlroot/cgi-bin/moderator/comments.pl view on Meta::CPAN
print <<HTML;
<script language="JavaScript" type="text/javascript" id="jsListbox">
var NS4 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) < 5);
function addOption(theSel, theText, theValue) {
var newOpt = new Option(theText, theValue);
var selLength = theSel.length;
theSel.options[selLength] = newOpt;
}
function deleteOption(theSel, theIndex) {
var selLength = theSel.length;
if(selLength>0) {
theSel.options[theIndex] = null;
}
}
function moveOptions(theSelFrom, theSelTo, moveAll) {
var selLength = theSelFrom.length;
var selectedText = new Array();
var selectedValues = new Array();
var selectedCount = 0;
var i;
// Find the selected Options in reverse order and delete them from the 'from' Select.
for(i=selLength-1; i>=0; i--) {
if(theSelFrom.options[i].selected || moveAll) {
selectedText[selectedCount] = theSelFrom.options[i].text;
selectedValues[selectedCount] = theSelFrom.options[i].value;
deleteOption(theSelFrom, i);
selectedCount++;
}
}
// Add the selected text/values in reverse order.
// This will add the Options to the 'to' Select in the same order as they were in the 'from' Select.
for(i=selectedCount-1; i>=0; i--) {
addOption(theSelTo, selectedText[i], selectedValues[i]);
}
if(NS4) history.go(0);
}
function selectAllOptions(selStr) {
var selObj = document.getElementById(selStr);
for (var i=0; i<selObj.options.length; i++) {
selObj.options[i].selected = true;
}
}
</script>
<script language="JavaScript" type="text/javascript" id="jsCal1Calendar">
var cal1Calendar = new CalendarPopup("CalendarDIV");
cal1Calendar.offsetX = 1;
cal1Calendar.showNavigationDropdowns();
cal1Calendar.addDisabledDates(null, "$firstYear-$firstMonth-$firstDay");
</script>
<DIV ID="CalendarDIV" STYLE="position:absolute;visibility:hidden;background-color:black;layer-background-color:black;"></DIV>
<script language="JavaScript1.2" type="text/javascript">
function catalogIDsubmitForm() {
document.comments.catalogIDreload.value = 1;
document.comments.submit();
return true;
}
function environIDsubmitForm() {
document.comments.environIDreload.value = 1;
document.comments.submit();
return true;
}
function validateForm() {
var now = new Date();
currentlyFullYear = now.getFullYear();
currentlyMonth = now.getMonth();
currentlyDay = now.getDate();
currentlyHours = now.getHours();
currentlyMinutes = now.getMinutes();
currentlySeconds = now.getSeconds();
var nowEpochtime = Date.UTC(currentlyFullYear, currentlyMonth, currentlyDay, currentlyHours, currentlyMinutes, currentlySeconds);
var objectRegularExpressionDateFormat = /\^20\\d\\d-\\d\\d-\\d\\d\$/;
var objectRegularExpressionDateValue = /\^20\\d\\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])\$/;
var objectRegularExpressionTimeFormat = /\^\\d\\d:\\d\\d:\\d\\d\$/;
var objectRegularExpressionTimeValue = /\^[0-1]\\d|2[0-3]:[0-5]\\d:[0-5]\\d\$/;
if( document.comments.remoteUser.options[document.comments.remoteUser.selectedIndex].value == 'none' ) {
document.comments.remoteUser.focus();
alert('Please create/select one of the remote users!');
return false;
}
if ( document.comments.commentData.value == null || document.comments.commentData.value == '' ) {
document.comments.commentData.focus();
alert('Please enter a comment!');
return false;
}
if ( document.comments.activationDate.value != null && document.comments.activationDate.value != '' ) {
if ( ! objectRegularExpressionDateFormat.test(document.comments.activationDate.value) ) {
document.comments.activationDate.focus();
alert('Please re-enter activation date: Bad date format!');
return false;
}
if ( ! objectRegularExpressionDateValue.test(document.comments.activationDate.value) ) {
document.comments.activationDate.focus();
alert('Please re-enter activation date: Bad date value!');
return false;
}
}
if ( ( document.comments.activationDate.value == '' && document.comments.activationTime.value != '' ) || ( document.comments.activationDate.value != '' && document.comments.activationTime.value == '' ) ) {
if ( document.comments.activationDate.value == '' ) {
document.comments.activationDate.focus();
( run in 0.791 second using v1.01-cache-2.11-cpan-d8267643d1d )