I'm having a little problem with getting data back out of Javascript arrays. I guess the two different methods or storing slightly different data somehow. My array is initialized as such:
If there is data present when the database is loaded then the arrays are populated like this:
Else, if the data is entered after the form has been loaded by the user then the arrays are populated like this:
In both cases the data enters the arrays correctly, the problem comes when I want to show it in a new textbox. If it was put in by the first method it displays correctly, but if it was put in by the second method I simply get a blank textbox. This is the code:
Any ideas where to look or suggestions on this one?!
Oh - in addition if the data is initially loaded from the database, but later edited by the user (hence stored with the second method) it will show up correctly in subsequent text boxes.
Many Thanks!
Code:
var payment = new Object();
payment.cc = new Object();
Code:
<% Response.Write("payment['cc']['cvs']="+rsCredit('CVS')+";"); %>
Code:
payment['cc']['cvs'] = document.getElementById('cvs').value;
Code:
document.getElementById("pay_r5").innerHTML = "<input type='text' name='cvs' id='cvs' size='3' tabindex='8' value='"+payment['cc']['cvs']+"'>";
Oh - in addition if the data is initially loaded from the database, but later edited by the user (hence stored with the second method) it will show up correctly in subsequent text boxes.
Many Thanks!