I am using jquery and the action Im trying to get is when a person clicks a button I have it slide down a hidden div underneath it and display the hidden div. Inside that div there is a form field with a submit button. How would I go about listening for the event of someone clicking the submit button inside that div? I cant seem to get it to work:
UPDATE: This seem to work, let me know if this is the proper way:
$('.button.green.table').live('click',function() {
var dataString = $(this).attr('title');
$("#formdiv" + dataString).slideToggle("fast", function() {
//Added, this works
$(this).find('.button').click(function() {
alert($('input[name$="notes"]').val());
return false;
});
return false;
});
});
EDIT SOME HTML:
<button class="button green table" title="1">Add Notes</button>
<div id="formdiv1">Notes<br /><input type="text" name="notes" value="12" />
<button class="button" id="buttontest">GO</button></div>
alert($(this).(':input').val());is not correct, could be your problem.