codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Get the image name  Solnyshko at 15:59 on Monday, May 19, 2008
 

I need to put the image name that was given in img tag into a form,or display it on the screen,help me please

  Re: Get the image name  o0DarkEvil0o at 21:41 on Monday, May 19, 2008
 

Functions:

function GetBaseName(file)
{
var Parts = file.split('\\');
if( Parts.length < 2 )Parts = file.split('/');
return Parts[ Parts.length -1 ];
}
function getE(ID)
{
return document.getElementById(ID);
}
function getImgName(id, opt)
{
img=getE(id);
names=(opt==1)?GetBaseName(img.src):img.src;
return names;
}
function showname(id, todiv, opt)
{
divs=getE(todiv);
names=getImgName(id, opt);
divs.innerHTML=names;
}
</script>


HTML

<img src="../images/b.png" id="imgs">
<div id="showfull"></div>
<div id="showbase"></div>
<script>
showname("imgs", "showfull", 0); // show full name
showname("imgs", "showbase", 1); // show base name
</script>


  Re: Thanks  Solnyshko at 08:18 on Wednesday, May 21, 2008
 

o0DarkEvil0o,thank you!

  Re: Get the image name  o0DarkEvil0o at 11:14 on Wednesday, May 21, 2008
 

Don't mind! Your're welcome!








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
• Re: Help Running VB script in Windows 2003
• ONUNLOAD
• Re: Insert Contents of .txt file into a .html page
• Re: Perl regular expression problem.
• Re: Problems in login using WWW::Mechanize
• searching for gd::graph guide
• Re: ARRAY OF HASHMAPS
• Adv. Regexp or Otherwise
• Adv. Regexp or Otherwise


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008