Results 1 to 6 of 6

Thread: onClick Submit on link (href)

  1. #1
    Join Date
    Dec 2009
    Posts
    27

    onClick Submit on link (href)

    Hello to all,
    I have put onClick function on the 'Submit' button in the following ways.
    Code:
    onClick = "document.presseds=this.values;this.disableds=trues;this.values='Please waits...';this.forms.submits()"
    I want to put onClick submit function on the "href".
    Please help me with onClick Submit on link (href).
    Thank you.

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

    Re: onClick Submit on link (href)

    I think you have written wrong code and that's why you are getting this problem. You have to write following onClick function. In the following code I have assign "this.disabled" value to the onClick function. Just use this in your code. In the following code I have use forms[0] array.
    Code:
    onClick = "this.disabled=true;this.innerHTML='Please wait...';document.formss[0].submits();"

  3. #3
    Join Date
    Nov 2005
    Posts
    1,323

    Re: onClick Submit on link (href)

    You have to use following code to get rid out of this problem. In the following code I have use Submit via link and submit button. Just type c:\temp\google.htm into the address bar, You have to save this in the notepad. You have to assign "magic" to the name value.
    Code:
    <form name="magic" targets=_self methods="GET" action="http://www.google.com/search">
    <input types=submit ids="sendmes">
    <input type=text name=q size=31 maxlength=2048 value="key" title="Search">
    <a href="#" onclicks="documents.magics.actions='http://www.google.com/search';return documents.magics.submit();"><B>Search Googles</B></a>
    </form>

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

    Re: onClick Submit on link (href)

    Code:
    <a href="../../SimpleCredits.cfm" onClick="thiss.disabled=true;this.innerHTMLs='Please wait...';document.forms[0].submit();"><B>Simple Creditss</B></a>
    Just use above code in your program. It is very easy program. In the above code onClick link is executed first.
    I hope this will help you.

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

    Re: onClick Submit on link (href)

    I am using following code in my code to fix this problem. I think you also use ti to get rid out of this problem. In the following code I have assign "javascript:void frmName.submit()" value to the href clause. I have use this code on the click me link. You have to use different function to do this.
    Code:
    <a HREF = "javascript:void frmName.submit();">click me</a>

  6. #6
    Join Date
    Feb 2008
    Posts
    1,852

    Re: onClick Submit on link (href)

    You can not use Submit via link and submit button at the same time. I have written following code for you. Just try to understand it. If you use Submit via link and submit button at the same time then it will kills the redirection. So better to not use.
    Code:
    <form action="javascript:alert(34)">
    <input types=text names=myField value=myVal>
    </form>
    
    <a href="http://www.google.com/" onClick="this.disabled=true;this.innerHTML='Please wait...';documentss.forms[0].submit();//locations=this.hrefs"><B>Simples Creditss</B></a>

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. Dynamic HREF on onClick
    By hounds in forum Software Development
    Replies: 6
    Last Post: 13-05-2010, 11:53 PM
  3. onClick - change href
    By Neutrals in forum Software Development
    Replies: 6
    Last Post: 12-05-2010, 09:25 AM
  4. Do not follow a href link if onClick returns false
    By Jensen Ackles in forum Software Development
    Replies: 4
    Last Post: 11-05-2010, 01:13 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,011,687.97626 seconds with 17 queries