velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhaoxin" <zhaoxin...@hotmail.com>
Subject Re: <input type="hidden" value=getYear()>
Date Tue, 14 Oct 2003 09:53:24 GMT
try like this

<form name="001" method="post" action="$link.setPage("002.vm")">
<input type="hidden" name="START_YEAR" value=getYear()>
<input type="submit">
<form>

<script>
window.onload = function() {
    document.forms["001"].START_YEAR.value = getYear();
}

function getYear() {
    return 2003;
}
</script>


----- Original Message -----
From: "Leina Last" <eyaposo@yahoo.com>
To: <velocity-user@jakarta.apache.org>
Sent: Tuesday, October 14, 2003 5:48 PM
Subject: <input type="hidden" value=getYear()>


>
> Hi
>
> Will appreciate if someone can help.
> I can't manage to get the value "2003" in <input type="hidden"
value=getYear()> from javascript if I have something like:
>
> function getYear() {
> return 2003;
> }
>
> <form name="001" method="post" action="$link.setPage("002.vm")">
> <input type="hidden" name="START_YEAR" value=getYear()>
> <input type="submit">
> <form>
>
> Java:
>  String year = data.getParameters().getString("START_YEAR");
>
> On my java server side the output of String "year" displays "getYear()"
instead of "2003". How can I get the value "2003" in the "value=getYear()"
part, making use of above example. Maybe a other way?
>
> I also tried something "value=window.getYear()". Will I need to make use
of a <div> or <id> tag ?
>
> Thanks
> L
>
>
>
> ---------------------------------
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search

---------------------------------------------------------------------
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