Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 21st, 2005, 01:13 PM
Authorized User
 
Join Date: Jun 2003
Location: , , India.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tgopal
Default input type="image"

Hi
I want to get the id's and name's of the image tags in my form dynamically using javascript
Ex.
If i have
<input type="image" name="image1" id="image1">
<input type="image" name="image2" id="image2">

I want to get the name and ids of the above two tags dynamically

I tried with document.images and document.form.elements it is not working.
Any suggestions on this

Regards
Gopalakrishnan

Reply With Quote
  #2 (permalink)  
Old September 22nd, 2005, 05:15 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Gopalakrishnan,

Try this...
Code:
function FindImageFlds(){
    var f = document.getElementById("myFormId");
    var els = f.getElementsByTagName("input");
    for(var i = 0; i < els.length; i++){
        var e = els[i];
        if(e.type == "image"){
            alert("found an image field, id: " + e.id + "; name: " + e.name);
        }
    }
}
HTH,

Chris

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
input type="image" tgopal Javascript How-To 1 September 22nd, 2005 05:16 AM
Problem with input type image With Anchor tag vinkumrect Javascript How-To 1 July 21st, 2005 08:59 AM
problem with input type="image" nerssi Javascript 6 September 14th, 2004 03:31 PM
<input type="File"> - Specify File Type and Path gp_mk Classic ASP Basics 2 August 2nd, 2004 03:07 AM



All times are GMT -4. The time now is 03:03 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.