Focus after submit

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nacho

    #1

    Focus after submit

    Hello..

    I have a problem with the focus that I had when the page reloaded, I
    dont know how to do it. I have 2 option selected in my page, when I
    select one option and the page automatic reload, and load the other
    select with the information that I selected before, but the focus star
    in the first field that is a Textbox, I want to still when I was before
    the load done.

    How I can do that?

    thenks

    Nacho

  • kaeli

    #2
    Re: Focus after submit

    In article <1116451418.064 886.147640@g44g 2000cwa.googleg roups.com>,
    mikicazares@yah oo.com enlightened us with...[color=blue]
    > Hello..
    >
    > I have a problem with the focus that I had when the page reloaded, I
    > dont know how to do it. I have 2 option selected in my page, when I
    > select one option and the page automatic reload, and load the other
    > select with the information that I selected before, but the focus star
    > in the first field that is a Textbox, I want to still when I was before
    > the load done.
    >
    > How I can do that?[/color]

    body onload="documen t.formname.elem entname.focus() "

    If that doesn't answer your question, please be more clear and supply code or
    a URL.

    --
    --
    ~kaeli~
    Do not taunt Happy Fun Ball!



    Comment

    • Nacho

      #3
      Re: Focus after submit

      Hello Kaeli, thanks for your answer but that's not the question.. I'm
      going to explain the problem..

      I have a page with some textbox and option select and when i captured
      the option select the second option select is loaded, but the setfocus
      It goes to the first textbox that is in the page not in the select
      option that I captured...

      I hope had been explain...

      Sorry for my english..

      Nacho

      Comment

      • kaeli

        #4
        Re: Focus after submit

        In article <1116532710.050 962.49580@f14g2 000cwb.googlegr oups.com>,
        mikicazares@yah oo.com enlightened us with...[color=blue]
        > Hello Kaeli, thanks for your answer but that's not the question.. I'm
        > going to explain the problem..
        >
        > I have a page with some textbox and option select and when i captured
        > the option select the second option select is loaded, but the setfocus
        > It goes to the first textbox that is in the page not in the select
        > option that I captured...[/color]

        If you're asking how to focus the select element when the page loads (instead
        of the text element), that's what I posted.

        If you are asking how to make one option of a select be the one that is
        selected, it depends a bit on what you meant by "reloaded".
        ASP.NET has controls that retain selections for you.
        If you're using another server-side process to make the page, you do it on
        the server-side.
        If you're doing dynamic selects with all client-side javascript, this might
        help you. It selects an option on page load. Modify it to suit your needs.



        I'm not here tomorrow or over weekends. If you need more help before Monday,
        feel free to e-mail me.

        --
        --
        ~kaeli~
        Local Area Network in Australia:... the LAN down under.



        Comment

        • enrique

          #5
          Re: Focus after submit

          If I understand the problem, it sounds like your page is losing state
          whenever it is refreshed. You want it to look the way the user set
          things before the refresh. So when you reload the page you need to
          either pass the element id of the control you want to set focus to on
          the URL, or keep the value in a hidden input field if you are doing a
          post. When the page refreshes, you now have the information available
          to you.

          Does that help?

          Comment

          Working...