Hello,
Could someone please help me out with a problem I am having trouble solving?
I am passing a variable through my URL to my forms page, such as:
mywebsite.com/form?var=Option1
And what I would like to do is set my select list field to be pre-set at 'Option1'. I have read through the forums and knowledge base and know that I have to put the following code into Form Manager > go to your form > properties > more options > form pieces > before form > custom:
$this->execPieceByName('ff_InitLib');
//fetch the url code
$mycode= JRequest::getVar('var');
//assign it to the form element
ff_setValue('dropdownlist' , $mycode );
The problem is it does not set the 'Option1' value to 'selected' and show it as the selected option in the dropdown box. It does work when I try to set a text field to the value passed but not a select list. Does anyone know how I can do this?
Thanks in advanced!
Nancy