PDA

View Full Version : How to pass value(from the same popup) to more than one text input.



mie2cod
12-05-2006, 02:58 AM
Hi.

I have worked the following which pass value from popup to one text input:

1) Index.html

<script>
function popup () {
//popup script
}
</script>

<form name="formname">
<input type="text" name="input1"><a href="javascript:void()" onclick="javascript:popUp('Pop.html')">Select</a>
</form>


2) Pop.html

<a href="javascript:void()" onclick="javascript:opener.document.formname.input1.value='Hello World!';self.close();">Hello World!</a>


How to pass the value from the same popup to more than one input, so i won't have to write 10 pop-up for 10 input. For example;

<input type="text" name="input1"><a href="javascript:void()" onclick="javascript:popUp('Pop.html')">Select</a>
<input type="text" name="input2"><a href="javascript:void()" onclick="javascript:popUp('Pop.html')">Select</a>

brandonH
12-05-2006, 04:03 AM
could you clarify what it is you are wnating a bit more. the above just confused me. lol

mie2cod
12-05-2006, 08:37 AM
Ok. I want to use the same pop up, to pass value into text input. Each input share the same pop up.

For example:

1) Index.html
<input 1> <a>popUp</a>
<input 2> <a>popUp</a>
<input 3> <a>popUp</a>

2) PopUp.html
<a onclick="document.form[0].....value="aaa">AAA</a>
<a onclick="document.form[0].....value="bbb">BBB</a>
<a onclick="document.form[0].....value="ccc">CCC</a>


Therefore, I can select either AAA, BBB, or CCC for input 1,
AAA, BBB, or CCC for input 2, and the same goes for input 3.