Combing JS and PHP on one button. Is it possible?
<p>Hiya:
i know some people would be so tired of my questions, but I'm working on a uni project and need to get it done as soon as possible. This question is about using JS on a button(button) and sending a php_my_sql update on the same button. The problem is JS uses button, right? but PHP uses button(submit). How can I get these two to work on one of these buttons, cuz there has to be only one button.</p>

<p>this is my code for JS</p>

<pre><code>&lt;script type="text/javascript"&gt;
function formAction(){
    var x=document.getElementById("collect")
    x.remove(x.selectedIndex)
}

&lt;/script&gt;
</code></pre>

<p>HTML</p>

<pre><code>&lt;form method="post"&gt;
    &lt;select id="collect" name="Select1" style="width: 193px"&gt;
    &lt;option&gt;guns&lt;/option&gt;
    &lt;option&gt;knife&lt;/option&gt;
    &lt;/select&gt; &lt;input type="**submit/button**" onclick="formAction()" name="Collect"  value="Collect" /&gt;&lt;/form&gt;
</code></pre>

<p>PHP</p>

<pre><code>    &lt;? 
    if (isset($_POST['Collect'])) {
    mysql_query("UPDATE Player SET score = score+10
    WHERE name = 'Rob Jackson' AND rank = 'Lieutenant'");
    }

?&gt;
</code></pre>
