Hi,

alert() is a javascript function for client-side javascript (ie
javascript inside a webbrowser). Forms make use of server-side
javascript (flowscript), and has nothing to do with client-side scripts.
Therefore, there isn't a function like alert() available. Similair, I
don't think that print() will work in client-side javascript.

There is a messages widget, to which you can add messages. I use it to
display messages in a form when a user submits a form with a repeater
that contains no rows (at least one row is required). The form
definition:
<fd:repeater id="evidence">
 <fd:validation>
  <fd:javascript>
   var success = widget.getSize() &gt; 0;
                        
   if (!success) {
    var messagesWidget = widget.lookupWidget("../messages");
    messagesWidget.addMessage(...);
   }

  return success;
 </fd:javascript>
</fd:validation>

You can do similair for add/remove events.

HTH,
Bart.

> -----Oorspronkelijk bericht-----
> Van: Thorsten Scherler [mailto:[EMAIL PROTECTED]
> Verzonden: dinsdag 31 mei 2005 13:11
> Aan: [email protected]
> Onderwerp: Re: [cforms] Alert is not defined
> 
> On Tue, 2005-05-31 at 11:54 +0200, Dennis Riedel wrote:
> > Hi Thorsten
> >
> > I tried to use alert() in my flowscript. I got the same error. I
think
> > this function is not defined for Forms (v3/Forms.js).
> > I used print() instead and found the print in my tomcat log.
> >
> > Dennis
> >
> 
> Cheers Dennis,
> 
> yeah but print is not really suitable as user message ;-) I solved my
> problem now with a simple message widgets but I will have a look
whether
> I can submit a patch to extend the Forms.js.
> 
> Thx for your feedback. :)
> 
> salu2
> thorsten
> 
> > Thorsten Scherler wrote:
> >
> > >Hello list,
> > >
> > >I am trying to use an alert within a cform but I got a
ReferenceError:
> > >alert is not defined.
> > >
> > >I am using the dynamicrepeater.xml from the example to add in the
> > ><fd:repeater-action id="addcontact" command="add-row"
> > >repeater="contacts"> an alert("test");
> > >
> > >Is it not possible to use alerts in CForms?
> > >
> > >TIA for any feedback.
> > >
> > >salu2
> > >
> > >
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> --
> thorsten
> 
> "Together we stand, divided we fall!"
> Hey you (Pink Floyd)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to