Can lookup update more than one field?

Sep 13, 2011 at 9:57 AM

Hello,

Im gathering some information to determine what I can use best in my MVC applications to have the user select e.g. a customer on an invoice. I found project Awesome and I am quite charmed of this large package of tools. I thought that I might be able to use the lookup, but I do have a question.....

Would it be possible to have the return value of a lookup not only fill the text box that is made by the Lookup HtmlHelper, but also have it changed values of labels or something like that? What I would like to achieve is that I have for example an invoice, on which the user can use a button to select a customer and that after selection of the customer, not only the customer's Id is filled in the textbox, but that also the name and address of the customer is displayed on the invoice form (read only).

Thanks in advance for your reaction!

Kind regards,

Björn

Coordinator
Sep 13, 2011 at 12:19 PM

do this:

$('#thelookupvalid').change(function(){

alert($(this).val());

});

Sep 13, 2011 at 12:51 PM

thanks! I will try this later on. At least now I know that this is possible! Kind regards, Bjorn

Sep 13, 2011 at 3:05 PM
o wrote:

do this:

$('#thelookupvalid').change(function(){

alert($(this).val());

});


I tested this on the Awesome demo app. It works well, but is there a way to use additional info from the selected record in the popup window (e.g. address, phone number) without using the Id of the record (value of the changed textbox) to fetch additional information in an additional call? Something like a way to extend the JavaScript of the Lookup Html Helper without having to change the code of the Html Helper itself?

Coordinator
Sep 13, 2011 at 6:58 PM

no, you have to do an additional ajax call