I already have this script
<FORM method="POST" name="ajax" action="#">
<INPUT type="submit" class="env_buttn" value="<?php echo "Generate"; ?>"
ONCLICK="gen_data()">
<div id="data_gen">
// generated html to be sent to check.php
</div>
</FORM>
What I want to do is send the generated html in the div to another php script check.php .
I’ve thought of adding another button but I don’t know how to do it properly. Any ideas ?
To get html from inside an element do this in javascript:
So that’s part of your question answered at least… What do you want to do with the html?
Assuming you want to do ajax style stuff… just add this function to an onclick event for a button:
One question that springs to mind is: What are you actually trying to do? Does the user somehow fill in the div? If yes then how? I’m pretty certain that changing your strategy would yield a more elegant solution but I’m unsure of the specifics… so, if this doesn’t solve your problem, can you give us some background info?