472,952 Members | 2,255 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

When replacing input type=file, "Browse" button, must click SUBMIT twice for form to

am replacing the default "Browse..." button for input type=file. This works fine except that the form will only submit after the SUBMIT button is clicked twice.

Any ideas on why this is happening or a workaround? I'm testing on IE

Thanks!

[HTML]<html>
<head></head>
<body>
<form name="test_form" method="post" action="test.jsp">
<input type=file name=browse style="display: none;">
<input type=text name=file>
<input type=button
style="font-style:veranda; font-size:12px; font-weight:bold;text-transform:lowercase;color:white;background-color:#A2C382;height:22px;border-style:ridge;text-align:center;"
onClick="browse.click();file.value=browse.value;"
value="Select a File...">
<br><br>
<!-- must be clicked twice for the form to submit! -->
<input type=submit
value="Submit The Form Now!"
style="font-style:veranda; font-size:12px;">
</form>
</body>
</html>[/HTML]
Oct 27 '06 #1
9 24676
Hi,

Replace onClick="browse.click();file.value=browse.value;" with

onClick="browse.click();file.value=browse.value; browse.disabled=true;"

This will solve the issue.

Thanks
Arul T
Nov 16 '06 #2
Hi,
I used the code you guys posted, it works perfect in IE.
If I use it in Firefox, when I click on the made up browse button, ti just copies the file path from the "browse" to "file", it does not allow me to browse.

This problem only in Firefox.
I guess it is the problem with browse.click()

Any help is appreciated.
Dec 12 '06 #3
I m also facing the same problem friend . Please help friends :-)
Feb 26 '07 #4
acoder
16,027 Expert Mod 8TB
Unfortunately, I don't think Firefox supports this.
Feb 27 '07 #5
dmjpro
2,476 2GB
one problem i facing while i submitting the page ....

actually ... disabled fields are not sent to the server for process ....
how can i send the file information after submitting the page ....

plz hel me out ....

thanx in advance .......
Feb 27 '07 #6
acoder
16,027 Expert Mod 8TB
Set the field's disabled attribute to true on submit using the form's onsubmit event handler.
Feb 27 '07 #7
The below does not work on Firefox. Any hints?


am replacing the default "Browse..." button for input type=file. This works fine except that the form will only submit after the SUBMIT button is clicked twice.

Any ideas on why this is happening or a workaround? I'm testing on IE

Thanks!

[HTML]<html>
<head></head>
<body>
<form name="test_form" method="post" action="test.jsp">
<input type=file name=browse style="display: none;">
<input type=text name=file>
<input type=button
style="font-style:veranda; font-size:12px; font-weight:bold;text-transform:lowercase;color:white;background-color:#A2C382;height:22px;border-style:ridge;text-align:center;"
onClick="browse.click();file.value=browse.value;"
value="Select a File...">
<br><br>
<!-- must be clicked twice for the form to submit! -->
<input type=submit
value="Submit The Form Now!"
style="font-style:veranda; font-size:12px;">
</form>
</body>
</html>[/HTML]
Aug 2 '07 #8
acoder
16,027 Expert Mod 8TB
The below does not work on Firefox. Any hints?
Welcome to TSDN!

Try this example/tutorial.
Aug 2 '07 #9
drhowarddrfine
7,435 Expert 4TB
You are missing quotes around some of the attribute names.
Are you using a doctype?
Aug 2 '07 #10

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

Similar topics

2
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and...
1
by: Ed | last post by:
Is there a way to replace the file browse button using a JPG? <input type=file name=filename>
4
by: Werner Kaiser | last post by:
Hi, I want to change the text for the file-browse button within a form: I have something like that: <FORM ENCTYPE="multipart/form-data" ACTION="<?php echo basename(__FILE__)...
5
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and...
5
by: Codeman II | last post by:
Hi there, I am building a form where the user must upload a picture and fill in his details. Now I have a problem as all of this is on the same form. How will I be able to have the Browse...
4
by: acord | last post by:
Hi, I want to change the name of Browse to Add... How can I modify the followoing html code? <form name="iform" action="" method="post" enctype="multipart/form-data"> <input id="file"...
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()...
5
by: hrpreet | last post by:
Hi All, I need the file chooser in the jsp, just for brosing and saving the file path in the database, so i have used the following code.I dont need to read the file content. I have to make it...
9
by: shapper | last post by:
Hello, Is there a way to make the browse button an image? Thanks, Miguel
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.