Forums

Dynamic Values- How to change behavior based on radio button

JamesTuttle 29 Aug, 2013
Hello! We have a hopefully simple need. We are creating a form field with 17 drop-down choices (this could be created as a radio button if easier).

Each choice should display a different pdf for the user to download (the pdf is an application). The choices are categories for the user to apply in, and each user must choose the category they are in to download their category's document.

Here is the site: http://sunnysbusinessawards.com.au/

What is the easiest way for us to set this up in a single webform?

Thank you!!!

James
JamesTuttle 30 Aug, 2013
Thank you for the quick reply Bob! I just found out the only thing we need the form to do is create a folder from the user name of the user who's logged in, and upload their files to that folder.

Here is the code we are trying to use, but is not working:

<?php
$user =& JFactory::getUser();
$form->set("upload_files_77", "/home/public_html/sunnys/upload/", "JOOMLA_PATH".DS."components".DS."com_chronoforms".DS."uploads".DS.$user->get('username').DS);
?>

Here is the form page:
http://sunnysbusinessawards.com.au/index.php/appupload1

And here is the article I am trying to follow:
http://www.chronoengine.com/faqs/2630-how-can-i-upload-files-under-some-users-folder.html

Could you tell me please what is wrong with the code we are using? As you can see, the form doesn't even display.

Please PM me if you would like admin access to check yourself.

Thanks!!!

-James
GreyHead 30 Aug, 2013
Hi James,

So this is now a completely different question?

I think that your code needs to be
<?php
$user =& JFactory::getUser();
$form->set('upload_files_99', 'upload_path', JOOMLA_PATH."/components/com_chronoforms/uploads/{$user->username}/");
?>

You **must** replace 99 (or 77) with the id of the file upload element as described in the FAQ.

The second parameter should stay as 'upload_path'.

I edited the path itself to remove the .DS. entries as that is no longer supported in the most recent Joomla! versions.

Bob
This topic is locked and no more replies can be posted.