この会話は、活動がないためロックされています。新しい投稿を作成してください。
この会話は、活動がないためロックされています。新しい投稿を作成してください。
Hello everyone
We had a requirement of single radio button in our project so we created it.
And in the form we have a question and options for that question are 5 single radio buttons which are different from each other.
I know how to make a radio button required. But here we have a requirement where either of the 5 should be choosed or it should throw an error . How can i acheive it
解決済! 解決策の投稿を見る。
表示
返信
いいね!の合計
If you have an Adaptive Form and you added a radio button, you should be only able to select one of the values. It looks like what you've done is create a table with individual check boxes inside each one of the cells. This makes them independent fields instead of a single field so you'd be able to select all of them. Check boxes can be selected individually, radio buttons are a group where only one is allowed.
If you want to use the same approach, on the commit event of each of your objects, you'll need to null out the other values. This would simulate a radio button. Note that the check boxes all hold separate values too - you have 5 field values instead of one value that equals the selected value. You could handle this with a hidden field.
Ideally you'd skip the table approach and use text and a radio button and use CSS to get the look and feel you're going for. If you try to show this on a mobile device it won't make any sense to the end user.
表示
返信
いいね!の合計
You are not clear where the radio button is used:
1 - do you mean the radio button is used in a component dialog
2 - on an AEM component that is visiable in a web page
can you please clarify.
表示
返信
いいね!の合計
I have a question in the Survey and the options for that question are 5 different single radio buttons . Either one of them should be choosed or it should throw an error that any one should be choosed
表示
返信
いいね!の合計
Hi Santhosh,
Any particular reason for going with 5 single radio button instead of a Radio button group?
表示
返信
いいね!の合計
We have a requirement where we need to use single radio buttons(which has one option) for options for a question
in a Table as shown above we have a question and 5 options and all of them are single radio buttons (independent) either any one of them should be choosed
表示
返信
いいね!の合計
If you have an Adaptive Form and you added a radio button, you should be only able to select one of the values. It looks like what you've done is create a table with individual check boxes inside each one of the cells. This makes them independent fields instead of a single field so you'd be able to select all of them. Check boxes can be selected individually, radio buttons are a group where only one is allowed.
If you want to use the same approach, on the commit event of each of your objects, you'll need to null out the other values. This would simulate a radio button. Note that the check boxes all hold separate values too - you have 5 field values instead of one value that equals the selected value. You could handle this with a hidden field.
Ideally you'd skip the table approach and use text and a radio button and use CSS to get the look and feel you're going for. If you try to show this on a mobile device it won't make any sense to the end user.
表示
返信
いいね!の合計
Santhosh,
What Lee mentioned would be an Ideal approach here for your use case else you will have to play a lot at scripting level. In case you want to customize the radio button here is one great blog written some time back:
表示
返信
いいね!の合計
表示
いいね!
返信
表示
いいね!
返信