I have a frames page that has a header, body and a footer. The header frame has an ajax autocomplete that returns a number and a string from a database.
Here is what happens. The user looks up a client in the autocomplete textbox. The ajax autocomplete give the user choices. the user selects the one he wants with either his mouse or the arrow keys and then presses ENT. THERE IS NO SUBMIT BUTTON.
The value that was returned by ajax needs to go to a php script where it will do a lookup by the customer number. The value returned by ajax is the customer's number.
This returned value is what I need help with. I need to get the returned ajax value into my query sting (GET) so I can populate the body frame with the correct info. I am having a really hard time with this and can't make any headway.
I know no javascript at all so please spell things out for me.
Here is the relavent code.
Expand|Select|Wrap|Line Numbers
- <form method="post" class="hdrForm" id="search" action="../../index.php?ds=2" target="_top">
- <input type="text" name="string" class="hdrInput" id="string" value=""><div id="acDiv"></div>
- </form>
Expand|Select|Wrap|Line Numbers
- var AC = new Suggest('string','acDiv');
- AC.ajaxTarget = '../../lib/inc/suggest.php';
- AC.chooseFunc = function(id,label)
- {
- document.forms.search.submit();
- }