Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically change the Textfield value in Velocity template?

Nageswarara Rao
Contributor
October 4, 2013

Hi,

I have tried the following code to change the text field value dynamically,

Java Code:

public String getTimeValue() {

return timeValue;

}

public void setTimeValue(String timeValue) {

this.timeValue = timeValue;

}

Velocity source:

<script type = "text/javascript">

function changeField() {

document.getElementById("field").value= $timeValue;

}

</script>

<body>

<td>TimeCriteria:

<input type="text" id="field" value = "" name="timeCriteria" onChange="changeField()"> </td>

</body>

But I am Unable to get the result in the textfield , Will any body check this source please and suggest me any modification required in the code.

Thanks in Advance.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2013

What do you mean by "unable to get result"? Where is your code placed? Where is it supposed to run? Does if do anything at all?

Nageswarara Rao
Contributor
October 4, 2013

Actually I need to get the Java String Variable value into velocity file and need to input that value to the Text field.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 5, 2013

I'm afraid that doesn't clarify any of the questions I've got. Could you tell us what the answers to my specific questions are please?

TAGS
AUG Leaders

Atlassian Community Events