Solved

POS/ getElementById - multiple similar ID tags on Html page

Posted on 2006-11-11
6
293 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
  • 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 27

Accepted Solution

by:
Ark earned 250 total points
ID: 17928510
wb.Document.Forms("ResultsForm", 3).submit
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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 27

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now