Solution 1 :

Assuming you are using javascript, it is certainly possible. Target the first element, something like this should work:

$('input[value="Geen"]').filter(':visible:first').prop('checked', true);

Solution 2 :

It can be done by making those radio buttons as default or checked true.

Problem :

Let’s say because of database restrictions 2 radiobuttons have the same value ( I know that it’s better without using this ). Is it possible accordingly to this picture:

4 radiobuttons image

to select the first of two the same values when opening the page? So in this example “Geen” has the same value as “Dagelijks”. When the page opens it should be “Dagelijks” that is pre checked (this depends on the value with this client ID, could also be wekelijks or maandelijks prechecked). Does anyone know if this is possible? Thanks in advance!


Comment posted by Sybrentjuh

Hi! The problem is the value if “Geen” is variable (smarty), say: {$profile.value} and “Dagelijks, wekelijks, maandelijks” are always the same. Do you think using $(‘input[value=”{$profile.value”]’).filter(‘:visible:first’).prop(‘checked’, true); would work?