You've defined your function after you reference it...
It needs to be created first then it can be referenced.
function getSelectedId(text, li) {
$('class_id').value=li.id;
document.forms['searchcustomerform'].submit();
}
new
Thanks for pointing out this error Matt. I should have noticed this.
But even after defining the function earlier, form submit doesn't work
:(
Sorry.
Sincerely,
Yogesh
Matt Foster wrote:
You've defined your function after you reference it...
It needs to be created first then it can
Hello,
I am glad to say that I found the root of the problem. I had a button
named submit and this was causing the problem.
Thanks so much Matt for pointing out the function definition error.
As Christo notes here: (http://www.spiration.co.uk/post/1232/Submit%20is%20not%20a%20function)
Hey Yogesh,
You may want to also look at how you're referencing the
form. Usually document.forms is a numerical array, not an
associative. I'd recommend using an ID on the form object and then
grab it
via $(form_id)...
document.forms['searchcustomerform'].submit();
vs
Hello,
Thanks for the reply. I tried doing that but it didn't work for me.If
you point out the mistake in following code, it will be great.Thanks
again.
script type="text/_javascript_"
new Ajax.Autocompleter("search","hint","server_class.php",
{afterUpdateElement : getSelectedId,
http://wiki.github.com/madrobby/scriptaculous/ajax-autocompleter
afterUpdateElement function...
you receive an input object and some element that was representing the
field. At this point you could execute form.submit..
--
http://positionabsolute.net
On Oct 7, 11:19 am, Yogesh