hyper link is not working as expected.need help!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rahullko05
    New Member
    • Oct 2008
    • 34

    hyper link is not working as expected.need help!!

    i am using this code in one of my .php file:

    <a href="thanks.ph p" onclick = "return registerUser(){ return false;}"> <input type="button" name="userText" value="Submit" id="memberRegis teration" /> </a>

    i am facing 2 problems here:
    1) button is not shown as hyper link when mouse is hovered over it?
    2) even when i am explicitely returning false on onclick function call, it goes to thanks.php page?

    thanks,
    Rahul
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    out of interest, why do you combine a button and a link? wouldn't be a single button sufficient?

    Comment

    • rahullko05
      New Member
      • Oct 2008
      • 34

      #3
      i combined button and link together, because this button is not of submit type. also because i am not just submitting data to server but based on whether it passes or fails i am moving to another page, which i believe can be done via using anchor tag around button.

      please suggest if there is any workaround for this?

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        use only the button and if the input is valid, use window.location .href in your script to get to the next page.

        Comment

        Working...