Once the PHP renders into HTML it becomes less a question of passing PHP to Javascript and more a question or how to get the value from the HTML with Javascript. Would adding an onclick call to the function work for what you are trying to do?
<input type="submit" value="Submit" onclick="send(this.form.pid.value);return false;">