Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Form scrolling

  1. #1
    New Coder
    Join Date
    Jul 2003
    Houston, Texas
    Thanked 0 Times in 0 Posts

    Form scrolling

    Ok, here is what is happening. I have a form with about 10 sections on it made up almost exclusively of radion buttons and check boxes. When I put the focus on the first element in a new section, I call a script to scroll the form so the the title of the new section is at the top of the page. However, even though I have checked the button or box in the new section, the form scrolls forward but the radio button or check box is not checked. I have to check it twice in order for it to be checked. This is getting frustrating for my users. Is there any way that this problem can be resolved. Here is some code I am using:

    <table width="100%" bgcolor="#336699" border="3" cellspacing="2" bordercolor="#eeeeff" rules="groups"
    bordercolorlight="#eeeeff" bordercolordark="#eeeeff">
    <td class="col_class" colspan="3"><u>Which of the following applies to your facility?</u></td>

    <td class="td_class" width="33%"><input type="radio" name="single_multi" value="S" onfocus="return moveWin(0,400); highlight(event)" id="000090">Single-story</td>

    Thank you
    Beyond a critical point within a finite space, freedom diminishes as numbers increase. ...The human question is not how many can possibly survive within the system, but what kind of existence is possible for those who do survive."

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Thanked 256 Times in 252 Posts
    Do you have return false in moveWin()? Change it to return true so that the onfocus event won't be cancelled. And take note that the highlight() function will never be called because of the return keyword.

    onfocus="return moveWin(0,400); highlight(event)"

    Maybe you want it like this:

    onfocus="highlight(event); return moveWin(0,400);"

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins


    Posting Permissions

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