How Do I Set A Default Value for a Radio Group?

I’ve got a Radio Group that I want to start up with a default value… so I want the first option blank_message to be set.

I’ve put checked="checked" in this input element but that doesn’t do it… what is the best way to do this?

<div is="dmx-radio-group" id="i_message_start_with" class="radio-group">

									<div class="form-check form-check-inline w-100">
										<div class="row c_right6 w-100">
											<div class="col px-1">
												<input class="form-check-input" type="radio" value="blank_message" id="radio_blank_message" name="start_with" checked="checked">
												<label class="form-check-label" for="radio_blank_message">Blank<span dmx-hide="browser.viewport.width&lt;576">&nbsp;message</span></label>
											</div>
											<div class="col px-1">
												<input class="form-check-input" type="radio" value="existing_message" id="radio_existing_message" name="start_with">
												<label class="form-check-label" for="radio_existing_message">Existing<span dmx-hide="browser.viewport.width&lt;576">&nbsp;message</span></label>
											</div>
										</div>
									</div>
								</div>

I’m still learning Wappler but I believe you do this by click on the input you want and under id, name etc you see static id (assuming your using static data) lets say you set this to 2. Then if you click the form radio group you see a Radio Group Properties area which has a value, then set this value to 2 or if you are using dynamic you’d use the lighting bolts to set your data. I haven’t really used radios yet but its a idea you can try

1 Like

Not the best demo of what I meant but this might help you (as I said still learning myself nut I hope this helps)

1 Like

Thank you sooo much @Sorry_Duh (great name!)…

That works perfectly! :slight_smile:

So easy to do but elusive. Thanks for that. Helped me too!

1 Like