473,383 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

how to make a button disappear after it is clicked once

onclick="this.href='javascript:void(0)';this.disab led=1">

ive tried that, but it renders it useless and doesnt make it 'submit'

it should be able to work, but so the user cannot submit it twice if they tried to 'machine gun' type thing using their mouse to submit repeatedly

I guess this can be considered an HTML problem not PHP but im using it in php in the sense that the button clicked triggers the form to load and it has data that is used in php to put into the database

= )
Apr 11 '07 #1
1 4468
bucabay
18
onclick="this.href='javascript:void(0)';this.disab led=1">

ive tried that, but it renders it useless and doesnt make it 'submit'

it should be able to work, but so the user cannot submit it twice if they tried to 'machine gun' type thing using their mouse to submit repeatedly

I guess this can be considered an HTML problem not PHP but im using it in php in the sense that the button clicked triggers the form to load and it has data that is used in php to put into the database

= )
This is definitely a JavaScript question.

As this can only be achieved via JavaScript, you don't have to worry about the href attribute.

So do something like:

[HTML]onclick="this.onclick=function() { return false; };"[/HTML]

If the onclick returns false then the browser will stop the link/form from being submitted.

So after the first click, the onclick will look like:

[HTML]onclick="return false;"[/HTML]

So next clicks will not trigger the form submission, or link submission etc.
Apr 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jared | last post by:
Radio Button or Check Box and Event Procedures I need to insert either radio buttons or check boxes onto my form. I'm not sure which to use, or if there are other options. I am using the buttons...
4
by: Neil Coleclough | last post by:
I am constructing a database to process product returns for my Company. I have a number of toggle buttons to identify the stage to which each return has been processed. For example, clicking the...
0
by: Oz | last post by:
Hi Using VS.NET 2003, Windows XP SP1, We have a page which has been developed using ASP.NET. On it, is a button which when clicked is supposed to add some data to a table. When the button is...
2
by: lghtslpr | last post by:
I have an imagemap with several hotspots, and I want a Google Maps-style "floating bubble" to appear when a hotspot is clicked. The bubble would contain some text, a picture, and a close button. I...
7
by: rsaffy | last post by:
I am having trouble with my dynamically created button's event handling. I read that the buttons need to be recreated on every trip to the server, but how exactly do you do that when the datagrid...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
3
by: mdburton | last post by:
onclick="this.href='javascript:void(0)';this.disabled=1"> ive tried that, but it renders it useless and doesnt make it 'submit' it should be able to work, but so the user cannot submit it twice...
5
by: Susan Bricker | last post by:
I have a command button that I'd like to make "disappear" after being clicked and after the OnClick function has executed. I have tried changing the 'visible' attribute to false while within the...
2
by: chupcha | last post by:
Hello all, I'm very new to java script and I need help. I have a couple of buttons on a page that I need to disappear when one of the buttons is clicked. What I found is this: ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.