Click here to Skip to main content
16,017,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friend
i am using geckoFX in place of IE i have done successful everything in IE(internet explorer) but inside geckofx i have suucessfuly access to input type radio but i can not make click

problem is i can not make click after go.setattribute("checked","checked")after this i want to do go.click but there is no click event inside geckoelement

please make the code correct
Collapse | Copy Code
C#
string shareno = (geckoWebBrowser1.Document.GetElementById("shareno" + i).InnerHtml).Trim().Substring(6).ToString();
              MessageBox.Show(train);
            //  train.Trim().ToString();
              if (trainno == train)
              {
                  for(J=0;J<=11;J++)
                  {
                  MessageBox.Show("goning to select the class with the help of j loop");
            Skybound.Gecko.GeckoElementCollection inputclick = geckoWebBrowser1.Document.GetElementsByTagName("input");
                  // GeckoInputElement inputclick = new GeckoInputElement(geckoWebBrowser1.Document.GetElementsByTagName("input")[0].DomObject);
                  foreach(Skybound.Gecko.GeckoElement go in inputclick)
                  {
                      //MessageBox.Show("now going to click class and i am in foreach");

                      //MessageBox.Show("PARENT ID" + go.Parent.GetAttribute('id'));
                      if (classs == "SL")
                      {
                          if (go.GetAttribute("type").Equals("radio") && go.GetAttribute("Name").Equals("classcode") && go.Parent.GetAttribute("id").Equals("sl" + i))
                          {
                             // MessageBox.Show("inside if");
                           go.SetAttribute("checked", "checked");
 

                              break;
                          }
 
                      }
                      else if (classs == "3A/C")
                      {
                          if (go.GetAttribute("type").Equals("radio") && go.GetAttribute("Name").Equals("classcode") && go.Parent.GetAttribute("id").Equals("a3" + i))
                          {
                             // MessageBox.Show("inside if");
                              go.SetAttribute("checked", "checked");
                              //  go.click();
                              //  go.Focus();

                              break;
                          }
 
                      }
                      else if (classs == "2A/C")
                      {
                          if (go.GetAttribute("type").Equals("radio") && go.GetAttribute("Name").Equals("classcode") && go.Parent.GetAttribute("id").Equals("a2" + i))
                          {
                             // MessageBox.Show("inside if");
                              go.SetAttribute("checked", "checked");
                              //  go.click();
                              //  go.Focus();

                              break;
                          }
 
                      }
                      else
                      {
                          MessageBox.Show("train not match with class");
                      }
 
                  }
 
                  break;
                  }
                  break;
              }
 
          }
Posted
Updated 1-Aug-12 4:18am
v3
Comments
Please change the title of the question to suggest the problem in particular.
You can't say like "no one is there to help me".
Sunny Tiwari 12-Aug-12 6:34am    
i made good effort and solve by myself; but dear next problem is problem is:- i have many table in web site i want to chose one table, table has id but tr and td do not have any attribute in td there are two element input element and strong input have coman attribute all input element have three attribute name “value are same” onclick event and type is radio span textcontent is different how to access input element as per span text

i need support if you know geckofx tutorial where i learn more so please suggest me
html code is

<table>
<tbody>
<tr>
<td>
<input type="rabio" önclick="setbank(paymentid,row,col)/>"

<span>Name of bank<span></span>some instruction</span>

</td>
<td>
<input type="rabio" önclick="setbank(paymentid,row,col)/>"

<span>Name of bank<span></span>some instruction</span>

</td>
<table><tbody><tr>
<table><tbody><tr>
<td>
<input type="rabio" önclick="setbank(paymentid,row,col)/>"

<span>Name of bank<span></span>some instruction</span>

</td>
<td>
<input type="rabio" önclick="setbank(paymentid,row,col)/>"

<span>Name of bank<span></span>some instruction</span>

</td>
<table><tbody><tr>
</tr></tbody></table></tr></tbody></table></tr></tbody></table></tr></tbody>
</table>

thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900