473,382 Members | 1,689 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,382 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 1496
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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:
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.