Hello.
Let's say I grab data from database and displaying it in the input text boxes. When user presses on the button I want to grab the data from those textboxes and display it in the table that will be generated in the new opened window. I can collect the data from input text boxes with the code similar to the one below. But how can I then grab that info and place it inside the table in the new window. Can anybody help?
<script>
function cycle() {
var aData = '';
for (var i = 0; i<document.pricesform.elements.length; i++) {
if ((document.pricesform.elements.type == 'text') || (document.pricesform.elements.type == 'hidden')) {
aData += document.pricesform.elements.value + ',';
}
}
alert(aData);
}
</script>
<form name="pricesform">
<input type="text" name="myTextA" value=http://www.webdeveloper.com/forum/archive/index.php/"apple" size="20">
<input type="text" name="myTextB" value="orange" size="20">
<input type="text" name="myTextC" value="banana" size="20">
<br>
<input type="text" name="myTextD" value="pear" size="20">
<input type="text" name="myTextE" value="peach" size="20">
<input type="text" name="myTextF" value="grape" size="20">
<br>
<input type="hidden" name="myTextG" value="pumpkin" size="20">
<input type="hidden" name="myTextH" value="cranberry" size="20">
<input type="hidden" name="myTextI" value="tomato" size="20">
<input type="button" onClick="cycle()" value="Check">
</form>
Let's say I grab data from database and displaying it in the input text boxes. When user presses on the button I want to grab the data from those textboxes and display it in the table that will be generated in the new opened window. I can collect the data from input text boxes with the code similar to the one below. But how can I then grab that info and place it inside the table in the new window. Can anybody help?
<script>
function cycle() {
var aData = '';
for (var i = 0; i<document.pricesform.elements.length; i++) {
if ((document.pricesform.elements.type == 'text') || (document.pricesform.elements.type == 'hidden')) {
aData += document.pricesform.elements.value + ',';
}
}
alert(aData);
}
</script>
<form name="pricesform">
<input type="text" name="myTextA" value=http://www.webdeveloper.com/forum/archive/index.php/"apple" size="20">
<input type="text" name="myTextB" value="orange" size="20">
<input type="text" name="myTextC" value="banana" size="20">
<br>
<input type="text" name="myTextD" value="pear" size="20">
<input type="text" name="myTextE" value="peach" size="20">
<input type="text" name="myTextF" value="grape" size="20">
<br>
<input type="hidden" name="myTextG" value="pumpkin" size="20">
<input type="hidden" name="myTextH" value="cranberry" size="20">
<input type="hidden" name="myTextI" value="tomato" size="20">
<input type="button" onClick="cycle()" value="Check">
</form>