You need to sign in to do that
Don't have an account?
Add values as we enter into the dynamically created textbox and show the added value in the fixed textbox instantly
Hi folks,
I have a requirement where i need to add the values(like 8,5,6 etc) that r entered into the dynamically created textboxes.
The fixed text box should populate with the added value as v enter the values into the dynamically created textbox.
I have vf and controller.
I just need javascript to perform the the addition of values from the dynamically created textbox instantly as i enter numbers and show in the text box.
TIA
I have a requirement where i need to add the values(like 8,5,6 etc) that r entered into the dynamically created textboxes.
The fixed text box should populate with the added value as v enter the values into the dynamically created textbox.
I have vf and controller.
I just need javascript to perform the the addition of values from the dynamically created textbox instantly as i enter numbers and show in the text box.
TIA
You can achieve this by javascript...
You can use onkeypress event and call javascript method...
then you can use document.getelementbyid to get the valye nad assign it to another box...
Thanks
Sandeep
Right. But, the text boxes are created dynamically. And Id's of the dynamically created textboxes will not be known.
So, how to overcome this?? Any sample code plz..
Thanks
you can go like this:
Add this event while you are dynamically creating the textbox. : onkeyUp="performAction(this)"
<input type="text" onkeyUp="performAction(this)" id="textBoxId"/> // dynamically created textBox
<script>
function performAction(dynamicElement)
{
//here you can perform your actions.
alert(dynamicElement.id);
}
</script>
select this as a best answer if it solve your problem.
Thanks