views:

34

answers:

1

Hello, i have in my jsp different addresses, I can choose to copy to my fields. I wanted to know if anyone has sample code in javascript to provide me, thank you.

http://www.freeimagehosting.net/image.php?87514f7c3e.jpg

Different editable fields . A list of address, when I select an address, I want to automatically informs my fields

+1  A: 

I think it's time to learn basic JavaScript/HTML DOM :) Here are some tutorials:

To start, you need to give HTML elements of interest an ID:

<input type="text" id="address">
<input type="text" id="otherAddress">

You can grab a specific element using document.getElementById():

var addressElement = document.getElementById('address');
var otherAddressElement = document.getElementById('otherAddress');

You can get the value by value attribute:

var addressValue = addressElement.value;

You can set the value by the same attribute:

otherAddressElement.value = addressValue;
BalusC
+1 few good example links and well structured
Andi