0

How to creat the button for 'Export'? Thanks!

I want to combine below two sets of code

<?php  

echo"<a href='export.php?'>Export</a>

?>
<?php  

echo"<input type='button' value='Export'>";

?>
6
Contributors
7
Replies
8
Views
6 Years
Discussion Span
Last Post by cliffcc
1

You'll have 2 options: (1) create a form so the button can submit to it's action or (2) you use the javascript onclick-event of the button to open export.php.

0

Or you can do something like this

<button><a href='export.php?'>Export</a></button>
0

Hi cliffcc

you need to add an 'onclick' event to make it work.

Try . . .

<button type="button" onclick="location='export.php'">Export</button>

Zagga

0

Or you can do something like this

<button><a href='export.php?'>Export</a></button>

I've used this method, but unless you include a type in your button tag it acts as a submit button. I recommend this small modification:

<button type='button'><a href='export.php'>Export</a></button>

edit: oops, didn't see Zagga's post. I've used the onclick solution and the href solution, both work.

Edited by dietdew12z: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.