beforeclick text is removed when clicking in the field, then the field is empty. Still the validation code thinks the field contains information, so no error goes off when submitting.

Test code:

%STARTFORM{
name="dropdownform"
action="view"
topic="%WEB%.%TOPIC%"
method="POST"
validate="on"
}%
%FORMELEMENT{
type="text"
name="To"
beforeclick="Who is going to read this"
mandatory="on"
}%
%FORMELEMENT{
type="text"
name="Subject"
beforeclick="What is it about"
mandatory="on"
}%
%FORMELEMENT{
type="submit"
buttonlabel="Submit"
}%
%ENDFORM%

-- ArthurClemens - 20 Jan 2009

This is a fix using javascript:

for(var i=0; i<document.dropdownform.elements.length; i++)
{
   if (foswiki.CSS.hasClass(document.dropdownform.elements[i], 'foswikiInputFieldBeforeFocus')) {
      document.dropdownform.elements[i].value = '';
   }
}

but the solution should be done in FormPlugin code:

-- ArthurClemens - 16 Jan 2010

Fixed in FormPlugin 2.0.

-- ArthurClemens - 30 Apr 2011

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads