• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

refreshing form fields

 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

I'm working on a jsp page that has a form with fields containing numbers derived from a database. I noticed a difference in the behaviour of IE as opposed to Netscape browsers in the way the fields populate on refresh or reload. In IE after an edit of one or more fields, if I then refresh the page the whole form and its fields repopulate with the original values regardless of what I typed in the fields earlier. This is the behaviour I want. But this is not how Netscape behaves. When I attempt the same thing in Netscape and reload the page, all the edited value changes I made in the fields remain. Is there a way to make sure Netscape loads all the original values just as IE does?

Alan
 
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure you need to? Most of the time when a user wants to revert the values they would use the button "Reset" which you put next to the Submit button.

One possible solution to your 'problem' would be to trigger the Reset action through a javascript function call in the page onload function.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the HTML/Javascript forum.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't believe that you can affect these default behaviors, but even if you could I would advise against it.

Users are accustomed to how their browser of choice behaves. Mucking around with that default behavior is likely to just tick them off. Netscape users could care less how things behave under IE, and IE users don't care how Netscape behaves.

Trying to make them behave like each other when such behavior is unnatural to the browser is pointless.
 
Alan Shiers
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim Baker,

Yours was the answer I was looking for. It's still amazing to me that after all these years of programming, I still look for complicated answers to problems when the answer is really quite simple and under my nose all the time. Sometimes you just can't see the forest for the trees I guess. The Reset button was the ticket I needed.

Much thanks,

Alan
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic