473,386 Members | 1,860 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.

setting the value of a file object

15
I have a control on me screen of type <FILE>. I want to set some value to that object from the database. I tried the following code using html.


[HTML]<html >
<head>
<script type="text/javascript">
function fun()
{
document.getElementById('j').value="hi"
alert(document.getElementById('j').value);
}
</script>
</head>

<body>
<input type="file" value="hello" id="j" />
<input type="button" onclick="alert(document.getElementById('j').value) ;"
<input type="button" onclick="fun();"
</body>
</html>
[/HTML]but none of the above showed proper values for alert. it was showing null.

If I'm entering some values into the file field manalyy then proper alert is coming.
If I change the file type to text, then it is setting the value in the textfield with the value in the value attribute.

So my question is how to I set the value into the <FILE> type through the code implicitly.
Nov 4 '06 #1
1 1663
acoder
16,027 Expert Mod 8TB
Setting the value of input file elements is usually not supported by browsers - see this link for more information.
May 27 '08 #2

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

Similar topics

2
by: Maverick | last post by:
In normal application the set and get of appSettings are simply as following <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="Log" value="1" /> </appSettings>...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
0
by: Severino | last post by:
Hi all, we have developed a .NET component for use inside Windows Forms: this component has been written using VC++.NET (2003) and is working perfectly when inserted inside VC#.NET or VB.NET...
3
by: Patient Guy | last post by:
Subject line would seem to say it all: How does one trigger the execution of a method within an object or any other code/function with the setting of an object property? More elaboration for...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
9
by: Doug Glancy | last post by:
I got the following code from Francesco Balena's site, for disposing of Com objects: Sub SetNothing(Of T)(ByRef obj As T) ' Dispose of the object if possible If obj IsNot Nothing AndAlso...
8
by: Andrus | last post by:
..NET 2 Winforms application. How to create new setting and set it default value in userSettings section of app.config file or overwrite existing setting value ? I found code below in this list...
4
by: mk | last post by:
Hello everyone, I try to set two properties, "value" and "square" in the following code, and arrange it in such way that setting one property also sets another one and vice versa. But the code...
0
by: Maric Michaud | last post by:
Le Wednesday 03 September 2008 15:57:50 mk, vous avez écrit : Your square property is not correctly defined, it recurselively call itself, it should be (I also avoided the extra lookup) : def...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.