473,386 Members | 1,798 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,386 software developers and data experts.

input type file - javascript prevents dialog showing - any ideas why?

OK, not strictly a PHP problem I guess but it occurred in my PHP project and
I could not find a suitable Javascript NG (under pressure, already extended
deadline.

I user a "file" input type on a form. Therefore when the user presses browse
a select file dialog appears.
I wanted to have a javascript message reminding the user to press "Add
Attachment" after selecting the file.

Therefore:

<input name="userfile" type="file" id="filetoupload1"
onMouseUp="alert('Remember to press \'Add Attachment\' after selecting the
file.'); return true;" />

However, If I have this the file dialog does not appear. I tried playing
around with the return value to no avail.

I tried a different event onChange, and everything seemed fine. Until I
tried manually typing into the text box and then the alert message just kept
on popping up whatever I done on the form unless I pressed browse again and
selected a different file.

Any idea what is going on here?

For now I have taken out the javascript but it will be very handy to put
back.

Kind regards

Dave

Jul 17 '05 #1
1 2180
Errr,

Actually Onchange seems to work now. There must have been some little bug
occuring or something. Before if I used on change and typed into the text
box, it repeatedly flashed up the alert message. But now seems OK.

Sorry to waste anyones time.

Regards

Dave
Jul 17 '05 #2

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

Similar topics

5
by: Gregg | last post by:
Hello all, I have been banging my head over a problem that I am having reading a comma seperated file (CSV) that can contain from 1 to 10,000 records. My code snipit is as follows: **Start...
3
by: Federico | last post by:
Hello, I can't find how to do this: I have an input of type=file and I want that when the user clicks on it, javascript checks if some checkbox is selected and if so, the file dialog is shown....
2
by: Ersin Gençtürk | last post by:
hi , I need to customize <input type=file , tag. I find a way to do that : on the client side by javascript and css first , I am hiding the fileupload object , then I am calling the click...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
1
by: ginnone | last post by:
<INPUT id="File1" style="WIDTH: 530px; HEIGHT: 22px" type="file" size="70" name="File1" onclick="myFunction;"> Using this code, I'm able to catch the event that occurs when I click in the...
4
by: Petr Vileta | last post by:
Sorry if my question was be here earlier, I'm new here ;-) I have html form where is the tag <input id="x" type="file" name="upload"> and another fields. After submit script on server take some...
3
by: oopaevah | last post by:
I want to have a separate button which invokes the "browse" button on an input type=file. In internet explorer the following code works ok, in firefox nothing happens. All I do is call click()...
12
by: Larry Bud | last post by:
I rarely crosspost, but this affects both ASP and Javascript REALLY odd bug that I ran across in ASP 3.0. I have an input type of file, user clicks browse, then places his cursor in the...
7
by: Tim Slattery | last post by:
I'm trying to handle the onChange event in an <input type="file"> element. In IE, there's no problem: the event fires when a file in the "open" box is doubleclicked, or the "Open" button in the box...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.