Support the ongoing development of Laravel.io →
Database Eloquent Blade
Last updated 1 year ago.
0

Do you want to create just one radio button?

You must use this code:

{{ Form::radio('NAME', 'VALUES', true, ['class' => 'form-control']) }}

Or this:

<input class="form-control" checked="checked" name="NAME" value="VALUES" type="radio">
0

I am displaying a list of results and you need to select one of these in the list of results to continue. However I need to pass some more values with the radio.

If I put an array in the second argument it throws and expected 'string' error and if I use an array as the 4th and last argument no values are passed

0

You can try with data-...

0
Solution

Hi Thanks for your response. Upon some research I dont think its possible to have multiple values in a radio, however I used some piped data in the value attribute and used php explode to put them into an array for retreival.

Form::radio('destinationValues',  
	$destination->RegionID.'|'. 
	$destination->RegionName.'|'.
	$destination->ParentRegionID,
	false)

$radioValues = explode('|',$formData['destinationValues']);

0

Sign in to participate in this thread!

Eventy

Your banner here too?

ottz0 ottz0 Joined 15 Nov 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.