MartinLev Posted February 13, 2013 Posted February 13, 2013 Hi all! I have a small problem, and I'm sure the solution is obvious, but I can't get it... I have a field with a list of values. On the layout, the field is set to display values as radiobuttons. In the php file « addrecord.php » (generated by the PHP Assistant), the values are written « back to back ». This make the web page cumbersome as the values appears in the same line (approx 10 values). So, the question is : where (and how) in the addrecord.php file can I put some code to make the radiobutton appears one above the other, just like that : Radiobutton 1 Radiobutton 2 Radiobutton 3 ... Thanks a lot ! Martin
webko Posted February 13, 2013 Posted February 13, 2013 Please post the code - there is most likely a foreach statement in there which can have a HTML break added to make them line up in the desired manner
MartinLev Posted February 13, 2013 Author Posted February 13, 2013 Yup! I didn't had access to the computer while I wrote my first message... But now I do! So here is the code that create the radiobuttons from the list vlaues of the FM database : <tr class="field"> <td class="field_name"> <?php echo str_replace(' ', ' ',htmlentities('Équipements',ENT_NOQUOTES,'UTF-8',false));?> </td> <td class="field_data"> <?php $fieldName = 'Équipements';?><?php $fieldValue = $record->getField('Équipements', 0) ; ?><?php getInputChoices("radio", $layout->getValueListTwoFields('Equipements', (isset($master_record)) ? $master_record->getRecordId() : $record->getRecordId()), $fieldValue, getFieldFormName($fieldName, 0, $record, true, 'RADIOBUTTONS', 'text'), 'text', $submitDateOrder);?> </td> </tr> I did try to add a <br> somewhere (I'm guessing it should be near the $submitDateOrder variable), whitout any success... Martin
MartinLev Posted February 13, 2013 Author Posted February 13, 2013 This thread on this forum explain exactly the same problem as mine. http://fmforums.com/forum/topic/84649-formatting-value-list-in-an-entry-form-one-value-per-line/ Martin
MartinLev Posted February 13, 2013 Author Posted February 13, 2013 Wait! I found the solution! I've edited the code for the function GetInputChoices in the fmview.php file and it worked! Martin
webko Posted February 13, 2013 Posted February 13, 2013 Which is good - until you actually want it all on a single line... This is why I dislike the API, you shouldn't need to edit a helper file to get the results you're after... Anyway, good you have a solution
Recommended Posts
This topic is 4556 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now