Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to refresh a page without using AJAX

 
Pavan BH
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How to refresh textbox without using AJAX.
Please help me in this topic.
for example when i select country the particular states should be displayed in dropdown.

Thanks you.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't want to access the server, then you'll need to keep all information on the client as part of the web page. You'll need JavaScript data structures that hold the lists of states for all countries of your menu.
 
Pavan BH
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I know by using the javascript the whole page will be refreshed but not the particular textbox
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand what you're trying to say. If all the pertinent data is part of the original page (in appropriate JavaScript data structures), then it doesn't need to be refreshed, neither whole nor in parts. You will need to write the JS code to change the states menu in response to a selection in the country menu, obviously.
 
Pavan BH
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank u
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think our naming requirements (http://www.javaranch.com/name.jsp) require a real last name, not just initials, but thanks for trying.

A web page in a browser like Internet Explorer or Firefox is stored in a hierarchical structure (the Document, or DOM). You can alter that document and its corresponding graphical section of the user's display will change without changing the content of the rest of the page, although the layout may be adjusted.

However, to do that, you need client-side scripting, such as JavaScript. AJAX is JavaScript plus communication back to a server.

The only way you can refresh the page without client-side scripting is to put a timer on page refresh using the HTML metatags. But that refreshes the ENTIRE page, not just part of it.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Pavan BH", My request that you change your display name to adhere to JavaRanch standards was not a suggestion. Valid display names are mandatory for participation on the Ranch. Please change your display name as instructed prior to your next post.

Be aware that accounts with invalid display names are disabled.

bear
JavaRanch Sheriff
 
Gopikrishna Madishetti
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do it by Javascript, it will not refresh the page. It will just load the data when you select a country.
Javascript is the best option.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic