Results 1 to 2 of 2

Thread: History.back show all hidden textfields

  1. #1
    Join Date
    Jul 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default History.back show all hidden textfields

    Hi,

    I am hiding two textfields on a list box field selection value i.e. depending on selected value of listbox, either textfield is visible or hidden. The form uses oracle database in backend that has few check. When database code throws an error, a different form is loaded with error message. Here user has ability to press back button which uses history.back(). The problem is when original form come back all hidded text fields are visible.

    I tried add code on windows.onLoad to hide textfields, but its not working.
    Help needed.

    Thanks,
    Vidya

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There is no such thing as:

    windows.onLoad
    I would imagine that what you are thinking of is:

    Code:
    window.onload
    However, history.back() doesn't always (depends upon the browser) execute the onload function of the page that it loads.

    So you should change history.back() to an actual link to the page. Then you can hide or show whatever you want onload.

    But I imagine you want history.back() because it preserves other choices the user has already made and/or data that they may have already entered.

    If that's the case, you need to use server side code, like PHP or asp, etc.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •