Append a hidden input element to the form.
$("your single form id").append('<input type="hidden" 
name="myserversecret" id="myserversecret"/>');

then append a different value depending on which textarea the user hit 
the "enter" button.

$("#myserversecret").val("I hit enter in the second textearea");

/c


Dan Atkinson wrote:
> Yes, that's a good idea!
> 
> How/what do you think I could pass something to the server though, to make
> it know which button was clicked? It doesn't seem to matter which button I
> run the click function on, it's always the same (first) one.
> 
> 
> Christian Bach wrote:
>> I see, i guess i have to pay more attention :)
>>
>> OK, how about this.
>>
>> var submitType = false;
>> $("your single form id").submit(function() {
>>      if(submitType == "type1") {
>>              // do something
>>      } else if(submitType == "type2") {
>>              // do something
>>      } else {
>>              return false;
>>      }
>> });
>> $("#ctl00_contentPlc_txtPassword").keydown(function(e){
>>      // set type
>>      submitType = "type1";
>>      // fire  submit.
>>      $("your single form id").submit();
>> });
>> $("#ctl00_contentPlc_txtOtherPassword").keydown(function(e){
>>      // set type
>>      submitType = "type2";
>>      // fire  submit.
>>      $("your single form id").submit();
>> });
>>
>> /christian

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to