this is the code output:
<fieldset id="Contacts">
<div onchange="update_client(); return false;" class="corporation">
<div>
<script type="text/JavaScript" language="JavaScript">
AutoCompleteManagercontactsearch = new
AutoCompleteManager('contactsearch',
'contactsearch_text', 'contactsearch_hidden',
'/contact/search', 'input', 'matches',false,
'/tg_widgets/turbogears.widgets/spinner.gif', 0.2, false);
addLoadEvent(AutoCompleteManagerclientsearch.initialize);
</script>
<input class="textfield" type="text" id="contactsearch_text"
name="contactsearch.text">
<img src="/tg_widgets/turbogears.widgets/spinnerstopped.png" alt=""
name="autoCompleteSpinnercontactsearch" id="autoCompleteSpinnercontactsearch">
<div class="autoTextResults" id="autoCompleteResultscontactsearch"></div>
<input class="hiddenfield" type="hidden" id="contactsearch_hidden"
name="contactsearch.hidden">
</div>
contactsearch.hidden is used to past the value in the _post, but is invalid for
the getElement, which required the id, contactsearch_hidden in this case.
Otherwise I will catch a javascrit error if the ID is wrong.
contactsearch_hidden works fine with the getElement() but event after an
onchange it is still assign to nothing.
Maybe there's something I dont see in the naming pattern and I catch the bad
one.
I'll check the doc if I can find anything useful.
Thank you
Francis
Le lundi 14 mai 2007 � 09:47 -0400, [EMAIL PROTECTED] a �crit :
> On Fri, 11 May 2007 at 16:37, Francis Lavoie wrote:
> > function update_client() {
> > var container = getElement("contactsearch_hidden");
> > var contact_id = container.value;
> >
> > But it look like the contactsearch_hidden (named like this in the widget
> > init) is not set until the form is submited.
> >
> > any clue for the right direction?
>
> The names used in the html of the form are different from the names used
> in the controller code. FormEncode does some magic on them. Check out
> the view source of the posted page and you'll be able to figure out the
> naming pattern pretty quickly. It is also documented in the FormEncode
> docs.
>
> --David
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---