Not just another Autocomplete question
Hi guys! I've got a little problem that maybe someone can advise me on.
I have program, that is used to enter orders (manufacturing orders). Basically, the user has two ways to do it. One is to enter the part number of an order and the program (with an ajax call) creates the list of operations that get performed to process that part. However, if the part has never been processed before, the user must enter the Process ID of the process to be applied.
The problem is this, both the Part Number and Process ID controls are Autocomplete controls. However, if the Part Number is discovered to already exist, I need to "turn off" the Autocomplete for the Process ID. I don't want to make it "Read Only", because, for documentation purposes, the user may change the value. I just need to be able to turn off the Autocomplete. Is this possible?
I've tried doing an unset on the control and re-creating it, but that doesn't work. You get an error message that the object (ie. $this->txtProcessId) doesn't exist, when trying to create a "new" one.
Any ideas?
Thanks,
LaCeja

Thoughts for you: I'm guessing your Autocomplete control is a server-side autocompleter; if so, in your server-side logic, you can just check a variable - the variable you'll set whenever you want to - and if it's set, return an empty set for the auto-complete matches. That effectively disables autocomplete. Would that work for you?
Yea, thanks Alex. I hadn't thought of that. I was focusing on a way to disable Autocomplete, but I think your idea will work. I'll try that out and see how it works.
Thanks again... and thanks for the very quick response!
LaCeja
Works perfectly! Thanks again, Alex!
My pleasure, good luck! Sometimes a speedy solution is all you need - no fancy architecture is necessary :-)