how to execute html tag in javascript
<p>my database calls certain functions by inserting commands inside angle brackets. i.e.&lt;#SUBMIT  title="Request Report"> will create a button that submits form (criteria) data to the engine for reporting. </p>

<p>Before that button gets clicked I want to check some date criteria so I have inserted an image link into my document which calls my javascript code. If all conditions are met I want it to run/click the above button. Here is my code, it all works until the &lt;#submit> part. Any suggestions would be gratefully welcome.</p>

<pre><code>function checkdate() {

    var currentTime = new Date();
    var startdate = document.forms[0].datescopestart.value;
    var startdate2 = startdate.split("/");
    var startdate3 = new Date(startdate2[2], startdate2[1] - 1, startdate2[0]);
    var totaldays = ((currentTime - startdate3) / 86400000);

    if (totaldays &gt; 100) {

        alert("You can only choose a start date within the last 100 days")
    } else if (startdate == "") {
        alert("You cannot leave the start date blank")
    } else {
        ("&lt;#SUBMIT&gt;")
    }
}
</code></pre>

<p><em><strong>EDIT</em></strong>
The source code behind the rendered &lt;#Submit> button is:</p>

<pre><code>&lt;input type=button value="Request Report" class=button onclick="showhide('reportbutton');selectAll(document.forms[0].customfieldexp);selectAll(document.forms[0].user);document.forms[0].submit()"&gt;
</code></pre>

<p>I'm not sure how to incorporate that into the javascript.</p>
