cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Messing, Elad" <>
Subject Validation errors behavior in CForms
Date Tue, 21 Jun 2005 13:39:11 GMT
Hello all
	This question has been asked before, but I couldn't find a
definitive answer :

	I have a Cform with validation in 1 field:

    <fd:field id="name">
      <fd:hint>Hint Hint</fd:hint>
      <fd:datatype base="string"/>
        <fd:length min="2">
	        <fd:failmessage>You should add name</fd:failmessage>

	Also , the form validation is being done in a JS function :


function validateRestaurantForm (form){
	var success = true;
	var nameWidget = form.lookupWidget("name");
	var typeWidget = form.lookupWidget("type");
	var errorsWidget = form.lookupWidget("errors");

	if (nameWidget.getValidationError() == null &&
typeWidget.getValidationError() == null){
	  	if (typeWidget.value == null && nameWidget.value == null
) {
			errorsWidget.addMessage("You must either select
a name or type");
	      	success = false;
	return success;

	The form is being called from a FlowScript:

function handleForm (){
	var form = new Form("forms/restaurant_main_search.xml");

	My problem is , that whenever I test the form, 	and make a
mistake (invalid string)- the error message (along with the invalid
value) stays on the form whatever I do. I press the link for the form
again, I close the browser, I open a new different browser application.

	Only when I restart the web-server it is gone, and the form is
"clean" again.
	I checked, and it is not "Caching". The actual FlowScript is
called every time.

	What could be the problem ?

	Thank you !


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message