I know this is stupid to even be trying, but it is as it is and I cannot change this fact. The fact that it is a dynamic HTML-generator (engine) that creates a page with several duplicate fieldnames, on this page (parent) there are links that opens a childwindow where the user can change fieldvalues by typing a new value in childwindow - press a link and see the change without submit. This is easy as long as the parent window has unique fieldnames otherwise thers an error or nothing happens.
Well this is my problem now - The parentwindow has several fields (input type=text and input type=hidden) that has same names.
Example:
<html>
<head><title></title>
<body>
<form>
Name:<input type=text name=my_name value="John Doe">
<input type=hidden name=my_name_id value=3>
Adress:<input type=text name=my_adress value="Street">
Phone<input type=text name="my_phone" value="123456"><a href="#" onClick=javascript:window.open('popfromtheParent.html','pop','toolbar=no,width=600,height=550,resizable=yes,top=75,left=150');>Change</a>
<br>-----------------------------------------------
Name:<input type=text name=my_name value="Graham Wills">
Adress:<input type=text name=my_adress value="654321">
Phone<input type=text name="my_phone" value="Backyard"><a href="#" onClick=javascript:window.open('popfromtheParent.html','pop','toolbar=no,width=600,height=550,resizable=yes,top=75,left=150');>Change</a>
</form>
</body>
</html>
This is a dynamic page and the amount of fields arent known until page is loaded. The type sofar is only "text" and "hidden".
I have made an effort in trying to keep track of changes in respective fields on parent window with arrays, like:
<script language="JavaScript">
function parseElements() {
var myArray = new Array(this.document.forms[0].elements.length);
[0].elements.length);
for (i=0; i<this.document.forms[0].elements.length; i++) {
[0].elements.value);
if ((this.document.forms[0].elements.type == "text" || (this.document.forms[0].elements.type == "hidden") {
globalArray = this.document.forms[0].elements.value;
}
}
}
</script>
Thus making an array with starting values and for each change put new values in another array.....etc.
Has anyone ever done this before and in that case was it succesfull and how? Is it at all possible?
Will be very glad for some kind of input on this
Well this is my problem now - The parentwindow has several fields (input type=text and input type=hidden) that has same names.
Example:
<html>
<head><title></title>
<body>
<form>
Name:<input type=text name=my_name value="John Doe">
<input type=hidden name=my_name_id value=3>
Adress:<input type=text name=my_adress value="Street">
Phone<input type=text name="my_phone" value="123456"><a href="#" onClick=javascript:window.open('popfromtheParent.html','pop','toolbar=no,width=600,height=550,resizable=yes,top=75,left=150');>Change</a>
<br>-----------------------------------------------
Name:<input type=text name=my_name value="Graham Wills">
Adress:<input type=text name=my_adress value="654321">
Phone<input type=text name="my_phone" value="Backyard"><a href="#" onClick=javascript:window.open('popfromtheParent.html','pop','toolbar=no,width=600,height=550,resizable=yes,top=75,left=150');>Change</a>
</form>
</body>
</html>
This is a dynamic page and the amount of fields arent known until page is loaded. The type sofar is only "text" and "hidden".
I have made an effort in trying to keep track of changes in respective fields on parent window with arrays, like:
<script language="JavaScript">
function parseElements() {
var myArray = new Array(this.document.forms[0].elements.length);
[0].elements.length);
for (i=0; i<this.document.forms[0].elements.length; i++) {
[0].elements.value);
if ((this.document.forms[0].elements.type == "text" || (this.document.forms[0].elements.type == "hidden") {
globalArray = this.document.forms[0].elements.value;
}
}
}
</script>
Thus making an array with starting values and for each change put new values in another array.....etc.
Has anyone ever done this before and in that case was it succesfull and how? Is it at all possible?
Will be very glad for some kind of input on this