473,513 Members | 2,313 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File Upload - Change key code for ENTER key on Browse Button

bsm
Hi,

I have File Upload control in my form. When I click Enter key, it
triggers "Submit" button event. So I wrote onkeydown function as
follows:

if (window.event.keycode == 13)
{
return false;
}.

hence "Submit" button didn't fire.

But I want to assign Spacebar keycode as follows (so that it will open
file upload window)

if (window.event.keycode == 13) window.event.keycode=32. But this is
not working.

Can anyone plz help me.

May 10 '07 #1
3 13001
bsm wrote:
Hi,

I have File Upload control in my form. When I click Enter key, it
triggers "Submit" button event. So I wrote onkeydown function as
follows:

if (window.event.keycode == 13)
{
return false;
}.

hence "Submit" button didn't fire.

But I want to assign Spacebar keycode as follows (so that it will open
file upload window)

if (window.event.keycode == 13) window.event.keycode=32. But this is
not working.
What about:
if (window.event.keycode == 32){
// code to fire up your file-upload-thingy.
}

And if you want people using a real internetbrowser to use your app, I
suggest you change your code so it catches those events too.
window.event is IE only...

Regards,
Erwin Moller

>
Can anyone plz help me.
May 10 '07 #2
bsm
On May 10, 7:01 pm, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
bsm wrote:
Hi,
I have File Upload control in my form. When I click Enter key, it
triggers "Submit" button event. So I wrote onkeydown function as
follows:
if (window.event.keycode == 13)
{
return false;
}.
hence "Submit" button didn't fire.
But I want to assign Spacebar keycode as follows (so that it will open
file upload window)
if (window.event.keycode == 13) window.event.keycode=32. But this is
not working.

What about:
if (window.event.keycode == 32){
// code to fire up your file-upload-thingy.

}

And if you want people using a real internetbrowser to use your app, I
suggest you change your code so it catches those events too.
window.event is IE only...

Regards,
Erwin Moller


Can anyone plz help me.- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -
Thanks a lot. your solution worked well.

May 11 '07 #3
Hi.
I have a samll doubt regarding file-upload button.
By default there will be "Browse" on type="file" button.
Can i make it to visible as button which bears "Load"(any other word
other than browse).
Please make it clear for me if u knew it.

Thanks in advance
Regards
Rajesh P

May 29 '07 #4

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

Similar topics

4
3951
by: atse | last post by:
Hi, In the file field <input type="file" name="file1">, can I modify the button "Browse..."? I want to hide the file field but show a button like "Open". When I click on this button, it catches a...
20
2439
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to...
1
2787
by: Jonatan | last post by:
Hi all, I'm trying to upload files doing something like gmail. I almost got it but I have a problem when I post the form. Basicaly, I am doing the following. When the user presses the link...
3
2836
by: Bijoy Naick | last post by:
I've written a simple file upload user control in VB .NET. It comprises of an InputFile HTML Server Control, an Upload button and a message label. User clicks on the Browse button of the...
0
1044
by: bsm | last post by:
Hi, I have File Upload control in my form. When I click Enter key, it triggers "Submit" button event. So I wrote onkeydown function as follows: if (window.event.keycode == 13) { return...
1
5438
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one...
12
2461
by: GuangXiN | last post by:
I want the file upload element disappear, instead of it, I place a text box and a button with my own css defination. but it doesn't work on IE7. What should I do now? <form action="upload.php"...
0
7265
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,...
0
7171
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...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7541
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...
0
5693
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,...
1
5098
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...
0
3240
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...
0
1607
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 ...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.