onclick event of button
Posted: Fri Aug 14, 2009 3:58 am
Hi,
I want to call a php script in onclick event of Button in HTML. I used the following code,
<input type="submit" name="button" value="button" onclick="login.php" />
when i click the button the page is not going to login.php and in apache i am getting an error "use of undefined constant login" .
In the input tag for attribute type i tried with both. type="button" and type="submit".
Really i have no idea what is the difference between button and submit for type attribute.
Can anyone pls help me out.
I want to call a php script in onclick event of Button in HTML. I used the following code,
<input type="submit" name="button" value="button" onclick="login.php" />
when i click the button the page is not going to login.php and in apache i am getting an error "use of undefined constant login" .
In the input tag for attribute type i tried with both. type="button" and type="submit".
Really i have no idea what is the difference between button and submit for type attribute.
Can anyone pls help me out.