cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Messing, Elad" <>
Subject WG: Validation errors behavior in CForms
Date Mon, 04 Jul 2005 11:32:09 GMT
Hello all
	This is an issue I couldn't get an answer to in the dev mailing list.
	I thought as it might be an "in-depth" issue maybe this is more development related, so I
thought I will post it here as well.

	I am sorry if this is "Spam" for you. If so - please let me know and ignore it.

	Thank you !


-----Urspr√ľngliche Nachricht-----
Von: Messing, Elad 
Gesendet: Dienstag, 21. Juni 2005 15:39
Betreff: Validation errors behavior in CForms

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