473,473 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

A simple questions


I am trying to get the FilePath element of the FileUpload control to a JS
variable. As I am pretty new to JS I have no idea how to achieve that. I
would kindly ask someone to point me to the right direction,... such as
where I should start with JS and possibly the solution to my concrete
problem....

This is the relevant code:
<script type="text/javascript">
var fileUploadPath;
function UploadButtonClick()
{
//get the FilePath property to the fileUploadPath variable
alert(fileUploadPath);
}
</script>

<asp:FileUpload id="FileUpload" runat="server"</asp:FileUpload>
<asp:Button id="Upload" Text="Upload file" runat="server"
OnClientClick="UploadButtonClick()"</asp:Button>

Thanks in advance,
M.V.
Jul 22 '06 #1
1 875

Użytkownik "Marko Vuksanovic" <ma*************@hotmail.comnapisał w
wiadomo¶ci news:73**********************************@microsof t.com...
>
I am trying to get the FilePath element of the FileUpload control to a JS
variable. As I am pretty new to JS I have no idea how to achieve that. I
would kindly ask someone to point me to the right direction,... such as
where I should start with JS and possibly the solution to my concrete
problem....

This is the relevant code:
<script type="text/javascript">
var fileUploadPath;
function UploadButtonClick()
{
//get the FilePath property to the fileUploadPath variable
alert(fileUploadPath);
}
</script>

<asp:FileUpload id="FileUpload" runat="server"</asp:FileUpload>
<asp:Button id="Upload" Text="Upload file" runat="server"
OnClientClick="UploadButtonClick()"</asp:Button>

It is a client-side JavaScript problem, so the solution is simple.
Just read the "value" property of the HTML file-input control.
Let's assume, that this control name is FileUpload then:

fileUploadPath = document.form_name.fileUploadPath.value;

ps.
Why do you need this ?
--
JS
BRE Bank Dev Team, Poland
Jul 22 '06 #2

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

Similar topics

1
by: yiyun | last post by:
Hi, I am new to mysql and I want to ask a simple questions. I would like to initialize my InnoDB table space and I configure like below: ...
18
by: Geoff Cox | last post by:
Hello, I am trying to print out the array values for a second time but get error on page message? Thanks Geoff <html>
1
by: Proteus | last post by:
Any help appreciated on a small perl project I need to write for educator/teaching purposes. I have not programmed perl for some time, need to get up to speed, maybe some kind souls hrere will help...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
1
by: E.T. Grey | last post by:
I have been busting my nut over this for pretty much most of the day and it is driving me nuts. I posted this to an mySQL ng yesterday and I have not had any response (I'm pulling my hair out...
7
by: javedna | last post by:
Hi guys Ive got a simple problem, im designing an online questionnaire and on submission the coding that I have used to validate whether a user has filled in all the questions is supposed to...
1
by: chelisek | last post by:
I have two simple questions: I am trying to create a document using an excel spreadsheet format. I am trying to create a column that will contain numbers, just plain numbers as in account numbers...
1
by: Itanium | last post by:
Hi all! I'm new to .NET Platform and got some simple questions about efficiency... To put you in situation, to say that I'm involved in the writing of a complex regex based lexer for use over...
17
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
4
by: maheshgupta0248 | last post by:
Hi all, Im a newbie in php, started learning php on my own. I want to create small website using php, that contains links for two simple webpages > C questions > C++ questions C questions...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
muto222
php
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.