473,775 Members | 2,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

disabling button click

I have form with one submit button.
All i want to create is to allow user to make JUST ONE button click.
After that click, button will be still displayed but it will be disabled.
How to make this ?

Dec 28 '06 #1
5 2058
one small thing... when the user clicks submit button ( and if all is ok ),
delete button will be displayed.
Delete button will be hided after you have deleted uploaded file. Then the
submit button should be enabled.

Basicly, you can make one upload, if you uploaded wrong file, you can delete
this one file.
And so on... Delete button will be _displayed_ after submit click, and after
that click, submit button will be _disabled_.

Dec 28 '06 #2
ASM
Joja a écrit :
one small thing... when the user clicks submit button ( and if all is ok ),
delete button will be displayed.
Delete button will be hided after you have deleted uploaded file. Then the
submit button should be enabled.

Basicly, you can make one upload, if you uploaded wrong file, you can delete
this one file.
The form's action usually needs to display a response file.

It is your php with form's action which sends back a page
with a submit button to delete the file just uploaded
no ?

It is not because you did just upload a file, you don't want immediately
upload a new one...

so you need to have your both submit buttons enabled.

The two submit buttons have same name and your php analyzing value of
this variable knows what to do : delete or save.

No need of JavaScript ... ! ! !

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Dec 28 '06 #3
It is not because you did just upload a file, you don't want immediately
upload a new one...
* Correct :-)

so you need to have your both submit buttons enabled.
* The second button is loaded/displayed _after_ you have clicked submit and
if there is a value in the db.
If there is a value in the db, just delete button should be enabled/showed,
without upload button.

So this is why i want to hide upload button after first upload.


Dec 28 '06 #4
ASM
Joja a écrit :
* The second button is loaded/displayed _after_ you have clicked submit and
if there is a value in the db.
If there is a value in the db, just delete button should be enabled/showed,
without upload button.
And how db knows next upload file (not yet chosen) will be uploaded ?
So this is why i want to hide upload button after first upload.
That is your php which have to do that, but you would have not to do it
because on response the file field will be empty and nothing will have
to be send once more (except if you re-display last uploaded file path).

<?
$disbleSend = $disbleDelete = 'disabled';
if($send == 'Send')
{
$disbleDelete = '';
}
else if($send == 'Delete')
{
$disbleSend = '';
}
else
$disbleSend = $disbleDelete = '';
?>

<input type=submit name="send" value="Send" <?= $disbleSend ?/>
<input type=submit name="send" value="Delete" <?= $disbleDelete ?/>
Now,
tell me how I do when button [Send] is disabled to upload a new file ?

This time with a little bit of JS ?

<input type=file
onchange="this. form.elements['send'][0].disabled=false ;
this.form.eleme nts['send'][1].disabled=false ;" />

(not tested)
You can also use JS to avoid user sends too times same file
(during time file is send user can believes action has failed)

<input type=submit onclick="this.d isabled=true" blah />

Don't forget :

<form blah
onsubmit="if(de l==1)
return confirm('Are you sure to want to delete this file?');">

<input type=submit name="send" value="Send"
onclick="del=0; this.disabled=t rue;" <?= $disbleSend ?/>
<input type=submit name="send" value="Delete"
onclick="del=1; " <?= $disbleDelete ?/>
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Dec 28 '06 #5
Joja wrote:
I have form with one submit button.
All i want to create is to allow user to make JUST ONE button click.
After that click, button will be still displayed but it will be disabled.
How to make this ?
You don't. If transmission fails and the user needs to return to the
form, the button may still be disabled and the user will be unable to
resubmit without reloading the form (losing the data entered in the
process).

Filter duplicate submissions server-side. If the process may take a long
time, remind the user of this with a note near the button, but don't
disable button itself.

Mike
Dec 28 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2061
by: Ralph Freshour | last post by:
How can I disable a button once it has been clicked? I want to prevent the user from clicking on it twice if they have a slow connection. Thanks...
2
7796
by: Jeelz | last post by:
Hi Guyz, Would appriciate any tip on disabling an ASP.NET LinkButton using client sided code like javascript. My Requirement is such that the user should be allowed to click on the link button only once (viz. he should not be allowed to submit the form twice). This stuff is easy when using a ASP:Button or HTML Button... but a link button has got me wondering how... plz help!
2
1380
by: Srinivas | last post by:
Hi, I have a webform with some dropdown menus, textboxes required and custom validators. I added a click event handler for the button in which there is code for processing. This processing takes around one minute. I want to disable the button after the user clicks on it so that he cannot click it again while the processing is going on. But when I do this using javascript, the button is getting disabled while the form is not getting...
1
1131
by: MattB | last post by:
I want to have a "finalize sale" button that disables it's self immediately when pressed (so they can't hit it twice). I thought putting mybutton.enabled=false in the click event would do it, but I guess that requires a postback. Any suggestions (or even better and example) on doing it on the client end so it's immediate and doesn't need a postback? Thanks! Matt
3
13104
by: Mark | last post by:
This is a solution... Often users want to keep clicking "submit" when they are waiting for server processing. Most apps these days like to disable the submit button to prevent this. You can't just disable the button in the OnClick event in ASP.Net because then the Click event won't post to the server (because you disabled it). I searched google groups, and there is a solution to this problem, but I didn't think it was clean enough and...
2
1382
by: Michael Groeger | last post by:
Hi all, I want to disable a button after it's clicked on the clients side, so that this cannot be clicked twice. I tried this with adding the "onclick" attribute to the button and disable the button then in javascript. Then I tried it using Page.RegisterOnSubmitStatement(), but when I then click the button the Click event is not fired on server side. Any ideas?
7
6994
by: Vignesh | last post by:
I have tab control which has some TabPages. I want to enable or disable the tabpages based on some condition. It is possible to that. Thanks in advance.
6
1837
by: emmajoh | last post by:
Hi I'm trying to disable IE contextmenu (on a right click) as I want to create my own. The problem is that since I've installed the latest version of the google desktop, the script doesn't work. No other script I found on the Internet is working anymore. As you can see below, I've tried to catch every event I'm aware of: ___________________________
1
4393
by: mssbass | last post by:
In order to disable the previous and next buttons on my form, I followed the attached code. The buttons seem to work fine except for one thing. When the form first opens, the next button is disabled; however, if you click on the forward arrow on the scroll bar and click the previous button which takes you back to the 1st form, the next button is now enabled! What am I doing wrong? I just need the next button to be ENABLED when I open...
0
9622
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9916
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8939
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7464
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5360
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4017
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2853
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.