Results 1 to 6 of 6

Thread: A Href And OnClick Button

  1. #1
    Join Date
    Jan 2010
    Posts
    74

    A Href And OnClick Button

    Hello to everyone. I am getting problem while working on the program. I have a function which gets executed from the link. But, I am getting problem when I try to use that same function execution with the onclick. I have done the following coding for that. So, if you find any problem in that, then please let me know about the error code:
    Link:
    <a title="Comment" class="h5_b" href="first.html" onclick="popup(this.href);return false;">Find</a>
    Button:
    <input name="Find" type="button" class="button_small" value="FindIt" onClick="javascript:popWindow('popup.html');return false;">

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: A Href And OnClick Button

    You need to take care for the HREF. A hyperlink to a source and destination . Enabling the source element of a link to switch automatically to its destination. The source of a hyperlink is generally an element of a hypertext document. The destination may be another element of the same document, then it is an internal hyperlink to the document. The destination can be another document or a specific element from another document. Some hypertext systems do not guarantee that the destination exists: in this case we may follow hyperlinks called broken, broken or dead.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: A Href And OnClick Button

    Hello, simply make use of the following format and then you will able to solve the error code which you are facing.:
    Code:
    <input type="button" onclick="window.location.href='http://www.techarena.in/'" value="Towards the Techarena.in">
    This syntax will hell you more.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: A Href And OnClick Button

    Hello, you can simply link in the two ways as below:

    Code:
    <input type=button onClick="parent.location='page.html'" value='Select IT'>
    OR
    Code:
    <input type=button onClick="location.href='First.html'" value='Select IT'>
    It willl simply solve your problem and you will able to get solved for your error code.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: A Href And OnClick Button

    Hello, if you are having any sort of problem with the syntax for the button onclick and then use that for your purpose. It will simply solve your problem. So, just make use of that and get solved for your problem :
    <form>
    <input type="button" value="Enter" OnClick="javascript:EnteringData();">
    </form>

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: A Href And OnClick Button

    Hello, you can create a link with the help of the syntax below:
    1. An absolute URL -
      • It is simple and it will simply points to the any other web page.
      • href=("URL name")
    2. A relative URL -
      • It will simply point to the file within a web site.
      • href=first.html
    3. An anchor URL -
      • It will simply point to the anchor within a page.
      • href="#top"

Similar Threads

  1. IE7 href + onclick - both happen
    By Ucchal in forum Software Development
    Replies: 5
    Last Post: 24-05-2010, 03:58 PM
  2. Replies: 6
    Last Post: 18-05-2010, 12:27 AM
  3. CSS Button onclick event href="#" onclick="
    By Cornnelius in forum Software Development
    Replies: 6
    Last Post: 14-05-2010, 11:20 PM
  4. Dynamic HREF on onClick
    By hounds in forum Software Development
    Replies: 6
    Last Post: 13-05-2010, 11:53 PM
  5. Cancel href via an onclick
    By Doshi1 in forum Software Development
    Replies: 5
    Last Post: 11-05-2010, 10:04 AM

Tags for this Thread

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
  •  
Page generated in 1,714,294,878.19615 seconds with 17 queries