dialog question

dialog question

Hi,
 
I'm hoping someone can help me out...
 
I have the following code for a dialog I'm presenting to the user
 

$(

function () {

$(

"#dialog-form" ).dialog({

autoOpen:

false ,

height: 300,

width: 850,

modal:

true ,

buttons: {

"Save" : function () {

var errorMessage = "" ;

if ($( '#reasonCode' ).attr( "value" ) == "" ) {

errorMessage +=

"Reason Code cannot be blank.<br>" ;

}

if ($( '#rejectComments' ).attr( "value" ) == "" ) {

errorMessage +=

"Comments cannot be blank.<br>" ;

}

if (errorMessage != "" ) {

$(

"#validationErrors" ).html(errorMessage);

}

else {

alert(

"Reason code - " + $( '#reasonCode' ).attr( "value" ))

$(

"#rejectButtonClicked" ).val( "Y" );

$(

'#manageTimecard' ).submit()

}

},

Cancel:

function () {

$(

this ).dialog( "close" );

}

}

});

});
 
Now I have the dialog-form id in the div tag wrapped around a form tag
<form>

<

div id="dialog-form"
title = "Reject Resubmission Form" style =" display : none " >

< table class = "timecardDetails" >

< tr >

< th > Date </ th >

< th > *Reason </ th >

< th > Description </ th >

< th > *Comments </ th >

< th > Requester </ th >

</ tr >

< tr >

< td > <%= todayFormatted %> </ td >

< td >

< select name = "reasonCode" id = "reasonCode" >

< option value = "" > Select Reason Code </ option >

< option value = "ASG" > Incorrect Assignment </ option >

< option value = "ASR" > Associate Request </ option >

< option value = "END" > Assignment Ended </ option >

< option value = "HRS" > Incorrect Hours </ option >

< option value = "HRT" > Incorrect Hours Type </ option >

< option value = "SUP" > Incorrect Supervisor </ option >

< option value = "SUR" > Supervisor Request </ option >

< option value = "VER" > Vendor Request </ option >

< option value = "WEX" > Incorrect Week Ending </ option >

</ select >

</ td >

< td > &nbsp; </ td >

< td >< input type = "input" id = "rejectComments" name = "rejectComments" value = "" class = "text ui-widget-content ui-corner-all" /></ td >

< td > &nbsp; </ td >

</ tr >

</ table >

< div class = "validationErrors" id = "validationErrors" ></ div >

</
div >
</form>
 
Now when I call a Java servlet the request.getParameter("reasonCode") is coming back null and not getting passed in the request, however, I do have the following code in the Save button function
alert( "Reason code - " + $( '#reasonCode' ).attr( "value" )) and it's showing the value fine.
 
Thanks.