Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

POS/ getElementById - multiple similar ID tags on Html page

Posted on 2006-11-11
6
Medium Priority
?
323 Views
Last Modified: 2012-08-13
I'm using the following call to activate s submit button on a web form (VB code below, web form html at end of this post):

wb.Document.getElementById("ResultsForm").submit

This works fine.  However, on pages that have mutiple "ResultsForm" ids (see html code below), I need to be able to specify which "ResultsForm" submit button I want to activiate.  I tried,

wb.Document.getElementById("ResultsForm")(3).submit
wb.Document.getElementById("ResultsForm").submit(3)

Neither worked.  What's the correct syntax here?  Thanks

(html from page, a page can have X number of ResultsForm ids.  NO, I have no control over the HTML/tags on the page)

      <form method="POST" action="details_ACH.cfm?aba=231082826" name="ResultsForm">
    <a href="details_ACH.cfm?aba=231082826">2310-8282-6</a>
      

 <input size="-4" type="submit" size="-4" name="details" VALUE="More ..." >
      </form>

                        
                  
                  </font>
                  </td>
            <td bgcolor="#F2F2F2">
      
                  ATLANTIC EMPL FCU                  
                  
                  </td>
            <td bgcolor="#F2F2F2">
                  NEWTOWN SQUARE      
                  
                  </font>
                  </td>      
    <td bgcolor="#F2F2F2">
     
        PA
       
     </td>
                  
<!-- End of table row -->
            </tr>

      <tr valign=top>
            <td bgcolor="#F2F2F2">            

                  2
                  </td>
            <td bgcolor="#F2F2F2">
                  
                  
                  

                        
 


            

      <form method="POST" action="details_ACH.cfm?aba=231170136" name="ResultsForm">
    <a href="details_ACH.cfm?aba=231170136">2311-7013-6</a>
      

 <input size="-4" type="submit" size="-4" name="details" VALUE="More ..." >
      </form>

                        
                  
                  </font>
                  </td>
            <td bgcolor="#F2F2F2">
      
                  LEHMAN BROTHERS BANK, FSB          
                  
                  </td>
            <td bgcolor="#F2F2F2">
                  WILMINGTON          
                  
                  </font>
                  </td>      
    <td bgcolor="#F2F2F2">
     
        DE
       
     </td>
                  
<!-- End of table row -->
            </tr>

      <tr valign=top>
            <td bgcolor="#F2F2F2">            

                  3
                  </td>
            <td bgcolor="#F2F2F2">
                  
0
Comment
Question by:adorenbaum
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 11

Expert Comment

by:Dany Balian
ID: 17925049
i dont think u can do it...
because ids assume that u have one id per page...
so each name should be unique!!

what u can do is name them... resultsform1, 2, 3, 4...
and then use: getElementById("ResultsForm1").submit

cheers,

dan
0
 

Author Comment

by:adorenbaum
ID: 17925122
Dan,

As I mention in my original post,  I cannot control the html so I can't rename etc.
0
 
LVL 28

Accepted Solution

by:
Ark earned 1000 total points
ID: 17928510
wb.Document.Forms("ResultsForm", 3).submit
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:adorenbaum
ID: 17930631
Thanks.  That did the trick.
0
 
LVL 11

Expert Comment

by:Dany Balian
ID: 17930794
*blush*
although it contradicts with its name, i didnt think a page could have different objects with same ids..
anyways, everyday we learn new stuff ;)

glad that the case is solved!

and good luck on the remainder of ur project!

dan
0
 
LVL 28

Expert Comment

by:Ark
ID: 17934907
Thanks for points, glad I could help
mrdany, forms are 'special' objects, which does can have same ids, while another objects can not
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question