Sample Agreement Generator
Here is another post about some little tool I've made..
This one will take a set of checkboxes and radio buttons (anywhere on a page, doesn't have to be in a table or anything) and turn it into a block of text.
Caveat: you can't have any other checkboxes or radio buttons on the page with this snippet, it will behave poorly.
Check out the source below to see how it works. 21 Lines long, the value="" can be as long as you want. Post a comment if you have any questions.
This could be used for any type of text generation.
| Sample | |
| Client gets the code | |
| I get the code |
Agreement
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.pack.js"></script> <table> <tr><td><input type="checkbox" value="This is a long paragraph of text that explains this part of the agreement" /></td><td>Sample</td></tr> <tr><td><input type="radio" name="1A" value="A paragraph of text explaining that the client gets the code. A paragraph of text explaining that the client gets the code. A paragraph of text explaining that the client gets the code. A paragraph of text explaining that the client gets the code. A paragraph of text explaining that the client gets the code A paragraph of text explaining that the client gets the code." /></td><td>Client gets the code</td></tr> <tr><td><input type="radio" name="1A" value="I get this code!!! I get this code!!! I get this code!!! I get this code!!! I get this code!!! I get this code!!! I get this code!!! I get this code!!! I get this code!!! " /></td><td>I get the code</td></tr> </table> Agreement<br /> <textarea rows="6" cols="40" id="agreement"></textarea> <br/><br/> <button onclick="process()">Process</button> <script type="text/javascript"> function process() { var agr = ""; $("input:checked").each(function(i){ agr += $(this).val() + "\n\n"; }); $("#agreement").val(agr); } </script>
Blog!
© Issac Kelly. Site by Servee.