onclick in echo

Ok, im back with new problems.
How do i add onclick calls function correctly?

echo ‘’;

When i click on it, it just refreshes.

When i tried onclick="’ . friend_request() .’" Clicking on it worked,but it sent request even if i just visited user’s page,but didnt clicked on it.In other words it called function without clicking on button.

I’m assuming you have a function called friends_request in Javascript?

[php]echo ‘’;[/php]

you can try this…

[php]echo ‘’;[/php]

Add a return false after it.

You last attempt is completely wrong…

No its actually a php function,i already know that its false.I have another post about it here:
http://www.phphelp.com/forum/general-php-help/how-to-call-a-php-function-when-i-click-submit/

check this out please if you can.Thank you.

Sponsor our Newsletter | Privacy Policy | Terms of Service