hi guys, i just want to ask how could i input an action to a link?? the best choice was to create a button which will do the act, however, im having difficulties with it. now my resort was to add the code to the link..meaning instead of the submit button to perform the action, the link will do it..how could i do that? thanks...^_^
xuexue 15
Junior Poster
Recommended Answers
Jump to PostPerform what kind of action? JS, PHP..?
<script language="javascript"> function doAction(){ alert("Hello World"); } </script> <a href="#" onclick="doAction()">Do action</a> <?php if ($_GET['act'] == "DoAction") echo "Hello World"; ?> <a href="myPage.php?act=DoAction">Do action</a>
Jump to Postput an event to your anchor link
ex. lets put a javascript onclick event on your anchor tag<html> <head> <script> function do_your_thing(){ //put want you want to happen here, ex. an alert script alert('End of the World!'); } </script> </head> <body> <a href='#' onclick='do_your_thing()'>click me</a> </body> …
All 6 Replies
CJesusSaves 6
Light Poster
vaultdweller123 32
Posting Pro
xuexue 15
Junior Poster
vaultdweller123 32
Posting Pro
vaultdweller123 32
Posting Pro
vaultdweller123 32
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.