Hi

I want to load new content into a container using .load
('content.html') after the user clicks on a menu item.

and in the new content is a form and i encountered 2 problems.

first is that the new content don't comply to my loaded css? the fonts
sizes are off and the content seem unformated.

second is that i cannot access the data in the new content in
jQuery.....
eg.
<form>
<textarea id='newtext'></textarea>
<input type='submit' id='formsubmit' value='Submit'/>
</form>

my jQuery:
$("#formsubmit").live("click", function(e) {
  e.preventDefault();
  $.post ("process.php", {newmsg: $("#newtext").val(), function
(response) {
    //response here
  });
});

i have no problem making the form submit using .live event handler but
there is no data in $("#newtext").val()
is there anyway i can make it live too?

I've searched some into this problem 2, that i think... is coz of $
(document),ready() only reads the initial DOM. and subsequently
inserted content cannot be used. I also realised that this problem has
persisted for a long time without much progress. events can be
rebinded using live() or livequeries, but what about data? and I also
realised that there is no way to force jQuery to reload the DOM.

so is there a workaround? i may have multiple new forms that loads
into the containers. the only way to workaround that I can think of is
going back to the basics and use a onclick event instead of a jQuery
event. but doesn't that defeat the purpose of using jQuery?

regards,
Isen

Reply via email to