I have a drop down. whenever user changes it to a particular field. I want to go back to the server (send the selected id) and get a response back. Response back will basically be 1 or 2
If it is 1. then I want to disable an element with id one
if it is 2. then I want to disable an element with id two
How can i achieve this using jquery?
what I have so far:
$('#product_prod_name').change(function ()
{get('/pages/response_back'
});
I’m kind of lost with jquery..
If I understand you correctly, the following should be a step in the right direction:
This assumes that your server will always respond with “1” or “2”. If it can have some other response, you may want to make this a
switch, or some other conditional check prior to disabling the element.