Welcome !

 Accessing form data from within a table that is nested in a frame

Author Message

  • Total Posts : 5
  • Scores: 0
  • Reward points : 0
  • Joined: 10/12/2015
  • Status: offline
Accessing form data from within a table that is nested in a frame Monday, October 12, 2015 7:49 AM (permalink)
I have an intranet site that contains two frames: one to enter a film ID number, the other to view the corresponding film image. The first part of the HTML coding for this site looks like this:
   <frameset cols="153,*" border="0" frameBorder="0" frameSpacing="0">
     <frame name="border" src="left_toolbar.asp" marginWidth="0" marginHeight="0" noResize="noresize" scrolling="auto">
         <body topMargin="0" leftMargin="0" bgColor="#ffffff" link="#0000ff" vLink="#0000ff">
           <form name="enterId" onsubmit="return sendData()" action="retv.asp" method="post" target="content">
             <table width="136" height="100%" bgColor="#000000" border="0" cellSpacing="1" cellPadding="2">
                   <td noWrap="nowrap" bgColor="#dddddd" colSpan="2">
                     <font face="arial" size="-1">
                       <input name="docId" value="" style="font-size: 12px; font-weight: bold;" type="text" size="14" maxLength="13"/>

For forms in sites without frames, we have been using a script that we run which will tell us what table (if there are nested tables) and what cell within that table our specific data is located in.
Dim ClaimID, ClaimIDs, c, t, EndResult, URL, Window, objIE, objShell, objShellWindows 
 Dim URLFound, i, html_table, n, x, reqmes, Mbox, SearchVar, Table, VarFound, f 
 URL = "http://mywebsite.com" 
    Window = "Title of Website" 
    SearchVar = "my variable" 
 N = Len(SearchVar) 
 Set objIE = CreateObject("InternetExplorer.Application") 
 Set objShell = CreateObject("Shell.Application") 
 Set objShellWindows = objShell.Windows 
 URLFound = False 
 'To Fix Item Not Found Error 
 For Each objIE In objShell.Windows 
 For i = 0 To objShellWindows.Count - 1 
 Set objIE = objShellWindows.Item(i) 
 On Error Resume Next 
     If InStr(UCase(objShellWindows.Item(i).LocationURL), UCase(URL)) Then 
         If InStr(UCase(objShellWindows.Item(i).FullName), "IEXPLORE.EXE") Then 
             If Err.Number = 0 Then 
                 If InStr(objShellWindows.Item(i).document.Title, (Window)) Then 
                     URLFound = True 
                     Exit For 
                 End If 
             End If 
         End If 
     End If 
 If URLFound = False Then 
    Msgbox "URL Not Found" 
 End If 
 c = 0 
 f = 0 
 t = 0 
 x = 1 
 d = 10000 
 VarFound = False 
 Do Until VarFound = True 
    On Error Resume Next 
    Set html_table = objie.document.getelementsbytagname("form")(t).getelementsbytagname("td") 
    If Err.Number <> 0 Then 
       Exit Do 
    End If 
    If Not html_table Is Nothing Then 
       If IsObject(html_table) = True Then 
          For Each Cell In Html_table 
             CellText = Cell.InnerText 
         CellValue = Cell.Value 
           d = c + x 
               x = c 
                   msgbox "CellText : " & CellText & vbNewLine & "CellValue : " & CellValue 
           Table = "objIE.Document.GetElementsByTagName" & chr(40) & chr(34) & "table" & chr(34) & chr(41) & chr(40) & t & chr(41) & ".GetElementsByTagName" & chr(40) & chr(34) & "td" & chr(34) & chr(41) & chr(40) & x & chr(41) 
                   EndResult = Inputbox (CellText & vbNewLine & vbNewLine & "Table & Cell",, Table) 
             c = c + 1 
       End If 
    End If 
    t = t + 1 
    c = 0 
    If t > 1 Then 
       EndResult = MsgBox("Would You like to stop?",vbYesNo, Table) 
       If EndResult = "6" Then 
          Exit Do 
       End If 
    End If 
 msgbox "ending, out of do loop"

What this code doesn't do is get past the FRAMESET/FRAME tags. Any suggestions on what we might be missing?
<message edited by lpeder6 on Monday, October 12, 2015 8:04 AM>
    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 3 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2017 ASPPlayground.NET Forum Version 3.9