cancel
Showing results for 
Search instead for 
Did you mean: 

browseTo Button

Former Member
0 Kudos

Hi Friends,

please let me know how to assign browseTo Button in Java Scipt & Html,so that the browser should be automatically choose c,d drives of system to attach some pdf files. The way I assigned is


<input type="Button" style="background-color: #ffffff" onclick="browseTo('C:Documents and Settings')" value="Browse " > </td>

Is this correct ,if not pls mail me how to do this.

Regards

CSM Reddy

Accepted Solutions (1)

Accepted Solutions (1)

kishorg
Advisor
Advisor
0 Kudos

Hi ,

use

<FORM NAME="oForm"

ACTION="repost.asp"

ENCTYPE="multipart/form-data"

METHOD="post">

<INPUT TYPE="file" NAME="oFile1"/>

<INPUT TYPE="submit" VALUE="Upload File">

</FORM>

Regards

Kishor Gopinathan

Former Member
0 Kudos

Hi,

thanks, it is working, but I want to assign the same colour for both buttons, upload file & browse.

<INPUT TYPE="file" style="background-color: #ffffff" NAME="oFile1"/>

<INPUT TYPE="submit" style="background-color: #ffffff" VALUE="Upload File">

I am getting two different colours for two buttons. pls mail me how to assign the same colour for both of them?

kishorg
Advisor
Advisor
0 Kudos

Hi ,

u can alternatively use this .

<html>

<head>

<title>File Upload Example</title>

<script language="JavaScript" type="text/javascript">

function HandleFileButtonClick()

{

document.frmUpload.myFile.click();

document.frmUpload.txtFakeText.value = document.frmUpload.myFile.value;

}

</script>

</head>

<body>

<form name="frmUpload">

<!-- Real Input field, but hidden-->

<input type="file" name="myFile" style="display: none">

<!-- Fake field to fool the user -->

<input type="text" name="txtFakeText">

<!-- Button to invoke the click of the File Input -->

<input type="button" onclick="HandleFileButtonClick();" value="Upload File" style="background: #ededed;">

</form>

</body>

</html>

Regards

Kishor Gopinathan

Answers (0)