Commit fc2f3b82 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Corrected autofocus of the first field. Made the javascript not so invasive

when choosing dates.
parent 99de0c07
......@@ -70,6 +70,7 @@ $ownerformatoptions[FORMAT_NAME_DISPLAYNAME] = sprintf($formatstring, get_string
$createview1 = pieform(array(
'name' => 'createview1',
'method' => 'post',
'autofocus' => 'title',
'elements' => array(
'createid' => array(
'type' => 'hidden',
......@@ -190,7 +191,7 @@ function stopDateDisallowed(date) {
function startSelected(calendar, date) {
if (calendar.dateClicked) {
var stopDate = $('createview1_stopdate').value;
if (stopDate == '' || stopDateDisallowed(isoDate(stopDate))) {
if (stopDate != '' && stopDateDisallowed(isoDate(stopDate))) {
$('createview1_stopdate').value = date;
}
$('createview1_startdate').value = date;
......@@ -200,7 +201,7 @@ function startSelected(calendar, date) {
function stopSelected(calendar, date) {
if (calendar.dateClicked) {
var startDate = $('createview1_startdate').value.replace(/\//g, '-');
if (startDate == '' || startDateDisallowed(isoDate(startDate))) {
if (startDate != '' && startDateDisallowed(isoDate(startDate))) {
$('createview1_startdate').value = date;
}
$('createview1_stopdate').value = date;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment