javascript - Display or use content from <div> tags -
i have form, hidden input:
<input id="producten" type="hidden" name="producten" value="<div class='simplecart_items'></div>"/>
i want content in between div's , use content submit form. content created when page loads. now, takes actual code (<div etc></div
).
hope can me this! familiar php , javascript.
thanks
without jquery can this:
<script type="text/javascript"> function formbeforesubmit() { document.getelementbyid('producten').value = document.getelementbyid('simplecart_items').innerhtml; return true; } </script> <div id="simplecart_items">mycontent</div> <form action="..." method="post" onsubmit="formbeforesubmit();"> <input id="producten" type="hidden" name="producten" value=""/> <input type="submit" value="send" /> </form>
but don't put whole div in value of input field.
Comments
Post a Comment