toolkit/components/satchel/test/subtst_form_submission_1.html

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 <!DOCTYPE HTML>
     2 <html>
     4 <head>
     5 </head>
     7 <body>
     9 <form id="subform1" onsubmit="return checkSubmit(21)">
    10   <input id="subtest1" type="text" name="subtest1">
    11   <button type="submit">Submit</button>
    12 </form>
    14 <form id="subform2" onsubmit="return checkSubmit(100)">
    15   <input id="subtest2" type="text" name="subtest2">
    16   <button type="submit">Submit</button>
    17 </form>
    19 <script>
    20   function checkSubmit(num) {
    21     netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
    22     return parent.checkSubmit(num);
    23   }
    25   function clickButton(num) {
    26     if (num == 21)
    27       document.querySelectorAll("button")[0].click();
    28     else if (num == 100)
    29       document.querySelectorAll("button")[1].click();
    30   }
    32   // set the input's value (can't use a default value, as satchel will ignore it)
    33   document.getElementById("subtest1").value = "subtestValue";
    34   document.getElementById("subtest2").value = "subtestValue";
    35 </script>
    37 </body>
    38 </html>

mercurial