Web Analytics Made Easy -
StatCounter help with a button inside an href that calls a function - CodingForum

Announcement

Collapse
No announcement yet.

help with a button inside an href that calls a function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • help with a button inside an href that calls a function

    myfunction(x)
    {
    .......
    <a name="SEARCH">
    ----do something
    </a>
    }

    <a href="#SEARCH"><input type="button" name="search_button" onClick="myfunction(x)" value="Search"> </a>

    Once the button is pressed, the function will display some info on the screen. There is already sth on the browser window, so I need the to focus on the new info that the function "myfunction" will display.

  • #2


    Why did you put button inside the <a> </a> tags?
    The button is already clickable.

    <input type="button" name="search_button" onClick="myfunction(x)" value="Search">

    But still, I don't know what you want to do.
    Glenn
    vBulletin Mods That Rock!

    Comment


    • #3
      on the program, on the windows browser there is a form.After pressing the button some search results will appear on the screen, at the end of the form. But the form covers the whole screen, so I want that after the button is pressed, the browser window goes down, so it will show the search results, not the form, without having to use the scrollbar.

      Comment


      • #4
        so basically you have this


        Form
        Form
        Form
        Form
        Form
        Form
        Form
        Results
        Results
        Results
        Results
        Results


        The Results are off of the page so you want them to come into view?


        You can either, Scroll the window down
        http://www.devguru.com/Technologies/..._scrollto.html

        or you can focus the last element of the form so it comes into view

        Code:
        document.FormName.ElementName.focus(); //Brings field into view
        document.FormName.ElementName.blur(); //Gets rid of focus on element
        You can place the eithr of the ideas above after the code for your search.

        Hope this gives you an idea...
        Eric
        Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

        Comment

        Working...
        X