Forums

Dynamic DropDown with AJAX

rodiusd 30 Jul, 2013
Hi,

followed the setup from a faq (how do I build a select......) to setup two dropdown boxes.

Only difference is that my data is situated in another db. So insted of using the DB Multi Loader, I used a CustomCode block in the ajax event followed by a CustomCode block to format the data.

However when testviewing my form i got the following message

( ! ) Notice: Undefined offset: 1 in C:\wamp\www\joomla31\administrator\components\com_chronoforms\form_actions\dynamic_dropdown\cfaction_dynamic_dropdown.php on line 25

and also a second on line 30.

It seems that there something wrong with the Dynamic DropDown action that i have put in the OnLoad event block.

Any idea what could have been wrongly defined here?
rodiusd 30 Jul, 2013
Hereby the callstack from the error:

( ! ) Notice: Undefined offset: 1 in C:\wamp\www\joomla31\administrator\components\com_chronoforms\form_actions\dynamic_dropdown\cfaction_dynamic_dropdown.php on line 25
Call Stack
# Time Memory Function Location
1 0.0004 380184 {main}( ) ..\index.php:0
2 0.1620 6202672 JSite->dispatch( ) ..\index.php:52
3 0.1817 6255304 JComponentHelper::renderComponent( ) ..\application.php:221
4 0.1947 6270088 JComponentHelper::executeComponent( ) ..\helper.php:339
5 0.2014 6348304 require_once( 'C:\wamp\www\joomla31\components\com_chronoforms\chronoforms.php' ) ..\helper.php:359
6 0.2098 6612792 process( ) ..\chronoforms.php:97
7 0.2279 7064872 HTML_ChronoForms::processView( ) ..\chronoforms.php:109
8 0.2284 7109888 require( 'C:\wamp\www\joomla31\administrator\components\com_chronoforms\form_actions\dynamic_dropdown\cfaction_dynamic_dropdown.ctp' ) ..\chronoforms.html.php:38
9 0.2288 7110112 CfactionDynamicDropdownHelper->load( ) ..\cfaction_dynamic_dropdown.ctp:3


Maybe this could help out. I'm stuck and don't know why.
GreyHead 30 Jul, 2013
Hi rodiusd,

Those line are processed if there is something in the 'Extra options extension' box of the action. The entries there should look like:
input_id:value=text,value=text
The first error occurs when there is no : and the second when there is no =

But if you are using Ajax then this box should be empty??

Bob
rodiusd 30 Jul, 2013
Hi Bob,

in the FAQ there is a reference that there should be at least an x in the "Options Extentions Box".

So removed it as you proposed and I no longer get the errors.

Now my second box is not filled but can check this now with a debug between my two CustomCodes.

Thanks for the help.
rodiusd 31 Jul, 2013
Hi Box,

when i leave the "Options Extensions Box" empty than the JS event is not included in the form html.

This results in no event being fired, so no look-up for the values to populate the second dropdown box.

When entering something then the JS script is included and events get executed but the errors return.

So what is wrong here?
simelas 28 Oct, 2013
Hi,
a simple solution to have the notice disappearing: put in the extra option extension box : `input_id:value=text´ or `x:x=x´ instead of x. The code is useless, does not interfere with ajax dropdown, but the notice disappear. Could that help for finding a solution ?
rgds,
simelas
This topic is locked and no more replies can be posted.