Thanks for your reply.
This is what I'm trying to achieve:
- I have a form where a user can select items to order
- While still in the form, I use JQuery to provide a preview of the
order. The text  is displayed in a popup dialog. It is formatted in
html.
- I want to save this html preview into a hidden field that I
retrieved later on once the form has been submitted.

Maybe I need to pass my html text otherwise... Any advise is welcome.

Thanks for your time and help

On May 20, 11:49 pm, "Michael Geary" <[email protected]> wrote:
> .val(foo) sets the value attribute of the selected DOM element(s). Being an
> attribute, it can't contain HTML. It would be as if you had this code in
> your page:
>
> <input type="hidden" name="previewText" value="<h2>Order Preview</h2>" />
>
> That wouldn't be valid HTML.
>
> I'm not sure what to suggest instead, because I'm not sure what your goal
> is. Could you back up a level and explain what you want to accomplish with
> the hidden field?
>
> -Mike
>
> > From: eclipseTalk
>
> > Hello,
> > I have an hidden field in a form defined as follow:
> >  <input type="hidden" name="previewText" value=""   />
>
> > To assign its value I used:
>
> > var contentText = "<h2>Order Preview</h2>";
> > $("input[name='previewText']").val(contentText);
>
> > It works fine but the html code is lost. Is there a way to
> > retain the html format?
>
> > Thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery (English)" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to