Search code examples
htmlformscdata

add html content to hidden form field


Is it possible to pass a chunk of html content to a hidden field and how would I do this?

Thanks

Jonathan


Solution

  • Yes - simply HTML encode the content (e.g. replace "<" with "&lt" etc...)

    You didn't specify which language you'll use for poplulating the field value, so I can't help with details of how to encode.

    Here's a reference of how to do it in jQuery.

    Here's Java