File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Update the values from Server! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Update the values from Server!" Watch "Update the values from Server!" New topic
Author

Update the values from Server!

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Hi All,
I want to know that I have one HTML page with simple two textbox fields. I want to know whether with the use of javascript can I update values of two text boxes(Not page) from server OR I have to use socket in JDK.
Please let me know,
Thanks in advance,
Angela
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
If you are asking, can you update the values after the page has been sent to the client, based on some action from the server, the answer is no. In other words, you can't send over the page, have them hit a button that processes something on the server like accessing a database, and then update the textboxes with that value, unless you go back to the server and reload that entire page.
Does that make sense. Basically, you can send over all possible answers and hold them in an array or something in javascript, and then update the textboxes on the fly based on the values in the array, but you can't go back to the server without reloading the page unless you are using an applet. HTML is static so once it is sent, can't update from server without going back to the server and resending the page.
Hope that answers your question,
Bill
Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Hi Bill,
Thanks a bunch!
How's Java scripts can save all answers from server into Array? For that do I have to use serverside javascript or clientside javascript? What is difference between serverside and clientside javascript?
Thanks in advance,
Angela
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
serverside javascript is similar to CGI or ASP or Servlets, in theory. I have never used serverside javascript, but I have used ASP and ColdFusion. When you make a request to a server for a page, before I send the page back to you I have some type of script that runs ahead of time. One thing you can do is have a database that fills an array in clientside javascript so that all of the data is sent back to the client. Don't do this for large database becuase the file would be too big, but this works good for small datasets. Then when it is on the client side, you can access the array as needed.
Bill
 
wood burning stoves
 
subject: Update the values from Server!
 
Similar Threads
Populating HTML select using JSON
Updates value from sever(Urgent)
validation.xml is miss firing
request.parameter
Performance issue(Loading the page)