velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barbara Baughman <baugh...@utdallas.edu>
Subject Re: Passing a Javascript generated value into velocity
Date Mon, 21 Mar 2005 19:00:47 GMT
No way around it.  Velocity is interpreted on the server, Javascript
is interpreted at the browser.  You can fill in the javascript code
with Velocity and then pass it to the browser to run the parsed
javascript.  But you can't create something in javascript and pass it
to Velocity.  Velocity is already done.

Barbara Baughman
X2157

On Mon, 21 Mar 2005, Sanden, Steve wrote:

> Hello everyone,
>
> Just wanted to know how it might be possible to do the following:
>
>
>
> I have a modal dialog that accepts a string value.
>
>
>
> //simple javascript that evaluates length of a string @ submit
>
> If ( myvalue.length < 5)
>
> alert('$esc.javascript($text.get("SY_msg_length_error","SY",$len))');
>
>
>
> where $len is an object array composed of the the javascript value
> 'myvalue.length' and the end result alert message reads something like:
>
> [This value is only 4 characters long. Must be at least 5.]
>
>
>
> The main problem I'm having is trying to find a way to make velocity
> recognize the javascript value, which I've been unable to do so far.
>
> I believe I understand why, but I'm hoping that there might be a way
> around it .. a way that I have as yet discovered
>
>
>
> Thanks in advance
>
> Steve
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message