473,385 Members | 2,243 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,385 software developers and data experts.

problem with setting image source dynamically

hi friends,i have a problem i m using this code for displaying image.this code is working fine when we run this code in internet Explorer but when the same page with this code i can in mozilla or firefox,the image is not display.i m very much frusteted,pls help me friend,this is the code i m using:
the javascript function:
Expand|Select|Wrap|Line Numbers
  1.   function loadIndividual(form) {
  2.     var gifName = form.vendorimageupload.value;
  3.     document.vendorimage.src = gifName;
  4.  
  5. }
and i call this function in this button:
Expand|Select|Wrap|Line Numbers
  1. <input type="file" name="vendorimageupload" id="vendorimageupload" onChange="loadIndividual(this.form)">
the image shold display in this :
Expand|Select|Wrap|Line Numbers
  1. <img name="vendorimage" width="147" height="135" id="vendorimage">
Sep 16 '07 #1
1 1497
gits
5,390 Expert Mod 4TB
hi ...

for refering the image-node you should use the standards-compliant dom method:

Expand|Select|Wrap|Line Numbers
  1. var img_node = document.getElementById('img_id');
  2.  
and then set the new img-src:

Expand|Select|Wrap|Line Numbers
  1. img_node.src = 'new_im_src.jpg';
kind regards
Sep 16 '07 #2

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

Similar topics

5
by: Apple Sauce | last post by:
I'm building a site that requires images to be placed into a table dynamically - the name of each image is drawn from a database reference. (e.g database entry is "images/image1.jpg" etc). The...
2
by: anand | last post by:
Hi all, I have created a custom control which displays Image using Graphics.. I am using this control in a different windows application. I am dynamically creating the control and putting that...
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
2
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have...
8
by: nick | last post by:
I have a problem and I've been using a cheezy work around and was wondering if anyone else out there has a better solution. The problem: Let's say I have a web application appA. Locally, I set...
4
by: chsadaki | last post by:
Hello.... I'm working on a page that finds the shortest path between two nodes. The problem is when I draw a node on the map(in the administrative page) to save it later in a mysql table, the...
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"...
2
by: daitasri | last post by:
Hi, I am using HTML,Javascript. I m trying to specify source path for a dynamically created element.But its not displaying the image.Please help me. I m using the following code: var...
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: 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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.