0

My program works to click a button itself with the following code in a web page:

public void onClick(View v) {
    // TODO Auto-generated method stub
    ourBrow.setWebViewClient(new WebViewClient() {
        public void onPageFinished(WebView view, String url) {
            // do your stuff here
            ourBrow.loadUrl("javascript:document.getElementById('G03').click()"); 
        }
});

But when I try to run it again in another web page, I realized there is no such document.getElementById('id') in the Javascript. Here is the Javascript:

<table width="100%" cellspacing="0">
  <tr>
     <td width="18%" class="tableHeading">Career</td>
     <td class="tableHeading">Program</td>
     <td width="20%" class="tableHeading">Campus</td>
     <td width="25%" class="tableHeading">Term</td>
     <td width="15%" class="tableHeading">&nbsp;</td>
  </tr>
  <tr class="rowSpacer">
     <td></td>
  </tr>
  <tr class="rowLowlight">
     <td class="data">Undergraduate</td>
     <td class="data">3642 - Photo; </td>
     <td class="data">KENS -Kens Campus</td>
     <td class="data">2012</td>
     <td class="data" align="right">
        <input class="button" type="submit" title="Update Enrolment" name="bsdsSubmit-0" value="Update Enrolment">
     </td>
  </tr>
  <tr>
      <td class="rowSpacer" colspan="5"></td>
  </tr>
  <tr class="rowHighlight"><td

I only copied the Javascript of the button, it was too huge to paste all them here. In this code, I only know: class="button" type="submit" title="Update Enrolment" name="bsdsSubmit-0".

1 Answer 1

2

You have to use something like this,

<input type="button" value="Update Enrolment" onclick="location.href='required url'" />
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.