Hello
I hope someone can put me on track to see this through.
The form below, I have stripped everything out of except the points of interest for my syntax challenge.
[CODE]
<form name=”products_{pb_id}” action=”{product_details_href}” method=”post”>
<input type=”hidden” id=”pb_id” name=”pb_id” value=”{pb_id}” />
<input type=”hidden” id=”myitem_id” name=”myitem_id” value=”{item_id}” />
</form>
I have created a popup to retrieve certain field values in which it functioned perfectly as I need providing I hard set the form name, products_974 (which in the test the “pb_id” value above is 974)
[CODE]<script type=”text/javascript”>
window.onload = function(){
var pw = window.opener;
if(pw){
var inputFrm = pw.document.forms[‘products_974’];
var outputFrm = document.forms[‘main’];
outputFrm.elements[‘size’].value = inputFrm.elements[‘item_idelso’].value;
}
}
</script>
What I am trying to do is bring the “pb_id” value from the parent so I can do something like this
[CODE]
<script type=”text/javascript”>
window.onload = function(){
var pw = window.opener;
if(pw){
var FormNameID = pw.document.getElementById(‘pb_id’);
var inputFrm = pw.document.forms[‘products_’+FormNameID];
var outputFrm = document.forms[‘main’];
outputFrm.elements[‘size’].value = inputFrm.elements[‘item_idelso’].value;
}
}
</script>
I am not fluent with Javascript and work a lot on “trial & error” but I have run out of the “trials” to try and would like to get some direction on how I can make this happen.
Thank you