I'm playing around with an idea here. I'm using Netscape only. I want to be able to use a onclick event on a 'a href=' tag to place a value in a text field on a form, then submit the form, but cancel the link that would ordinarily take place by clicking on the 'a href' tag.
the function I'm using:
function setprojecttype(v_in)
{
document.f_main.showproject.value='1';
document.f_main.submit;
}
the tag
echo "[<a href='".basename($PHP_SELF)."' onclick=\"setprojecttype(1);\">Link</a>]";
The value gets set in the field to 1, but the link behaves like a normal link, instead of submitting the page (ie, my echo $HTTP_POST_VARS['showproject']; returns a "").
Does anyone know of a way to stop the link from occuring? I realize there are about 100 other ways around the problem, I was hoping that I could figure a way to stop the hyperlink from going to it's href value.
Thanks in advance
Aaron M.