Is there a way to get the value from a div element within a form instead of using a input?
I know it's kinda a dumb question, but I just want to know if its possible. Something like PHP DOM?
Or is there a way to possible changing the div to an input when hitting submit?
Thanks,
With Javascript, you can put the div's content into a (hidden) input right before you submit the form.
It will approximately look like this in jQuery:
$('#myForm').submit(function() {
$('#myHiddenInput').val($('#myDiv').html());
});
Edit: Why are you guys talking about AJAX? There's no need of using AJAX in this situation!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With