Click to See Complete Forum and Search --> : re-print changed table data
VileFriend
09-08-2003, 06:25 PM
I have a page where I wish to update the displayed information within a specific html table. How should I redraw that individual html table so that it displays the changed data in the JavaScript variables? In other words is there a method to document.print in the specific area of the page where this table is? The page I wish to update without creating another window is Refresh or Re-print? (http://homepages.paradise.net.nz/richka/files/VCA-While008.html ) and I suppose I could almost just 'refresh' the page with the new data but that would involve cookies wouldn't it? Any guidance would be appreciated thank you.:)
Khalid Ali
09-08-2003, 10:07 PM
Your qestion is kinda of vague,Here is what I could understand...
1. you have a web page loaded,and you want to change the data in teh table at run time???
if so youwill need to use DOM methods to access the table element and then update any data you wish.
2. If you wish to update the table at run time with some data chagned in the database or in a file,there is no way you can reload the page wihtout reloading the page....-)
VileFriend
09-08-2003, 10:35 PM
Thanks so far Khalid Ali what I am trying to do is replace the question in the bottom table with another question which is entirely stored in JavaScript variables. So what I really need to be able to do is know exactly whereabouts to 'document.print' the new question! This may involve blanking oput the original question but I think changing the background colour would be quite good anyway. What are 'DOM methods' and is it possible to know the location of the table without re-printing the rest of the page?
So, no I don't really want to update the table data at runtime, I sort of need to know where that text is so I can physically overwrite it. The data is not actually in a database but merely manipulated with JavaScript which I thought I could then write on the display in a while() loop? Or am I severely misguided:confused:
Khalid Ali
09-08-2003, 11:06 PM
assign an id attribute to your <b> tag that encloses the script tags in it.
<b id="data"></b>
and instead of using document.write
use document.getElementById("data").innerHTML = "any data haere"
then when user preses some button you can recall the above and change the appropriate message
VileFriend
09-08-2003, 11:42 PM
Thanks Khalid, I will try that out soon.
VileFriend
09-09-2003, 07:09 AM
Good one Khalid! Had a practise but do need extra guidance s'il vous plait. Self explanatory page here: Re-print but similar! (http://homepages.paradise.net.nz/richka/files/VCA-While008.html):D Note, if you keep clicking yes the number counts down but doesn't really draw attention to the fact it's different as the change is negligible. Suggestions:confused:
Khalid Ali
09-09-2003, 07:13 AM
What am I suppose to do on the page to simmulate what you are trying to do?
VileFriend
09-09-2003, 08:13 PM
If you click the yes button, it changes the question once but on subsequent clicks the decrement to the number on the right is not particularly obvious!:( How should/could I hilight the number at least to draw the user's attention to the fact it's changed? You will notice that it changes with each click. Can I hilight that somehow?
VileFriend
09-10-2003, 07:55 AM
:) Well Khalid Ali, I am slowly slowly catchee monkeying around but I do still need some wizened guidance please. Have a look at my practice page now: Control the text but not the background object? (http://homepages.paradise.net.nz/richka/files/VCA-While010.html) Any suggestions?