Using Ajax to enable Checkbox
Posted: Wed Jan 04, 2017 3:53 am
Hi.
I am building a tool that allows Administrators to enter a stock code, which runs an Ajax query to see if a "stock banner" is assigned to the product from the products DB table.
As they type, it searches. When it finds that stock code in the database, and sees it has a 'stockbanner' assigned, it displays that banner.
What I want to do, is to make a "Use Stock Banner Image" checkbox to appear when that image appears, so they can click it and use that, instead of having to upload a new banner.
I don't think I can just pop in a checkbox field into the Ajax results, below the <img> tag, as that runs outside of the <form>.
So I was wondering, a) if that is now possible to do, or b) if when there is a result found, it can set "disabled" to be enabled on the checkbox field that will always be displayed.
So user starts typing in the stock code... and if the image appears, the checkbox field basically "unlocks".
Possible?
I am building a tool that allows Administrators to enter a stock code, which runs an Ajax query to see if a "stock banner" is assigned to the product from the products DB table.
As they type, it searches. When it finds that stock code in the database, and sees it has a 'stockbanner' assigned, it displays that banner.
What I want to do, is to make a "Use Stock Banner Image" checkbox to appear when that image appears, so they can click it and use that, instead of having to upload a new banner.
I don't think I can just pop in a checkbox field into the Ajax results, below the <img> tag, as that runs outside of the <form>.
So I was wondering, a) if that is now possible to do, or b) if when there is a result found, it can set "disabled" to be enabled on the checkbox field that will always be displayed.
So user starts typing in the stock code... and if the image appears, the checkbox field basically "unlocks".
Possible?