function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SATZSATZ 

How to validate a checkbox in visualforce page

I am using a two checkbox fields Present And absent  in visualforce page.That is an  fields  in custom object (Attendance)

 

I requiemnt is

1)once open the visualfroce page(popup window)must should be we need to select the present or absent checkboxes for each row untill selected is not to be saved in object.


i try multiple ways but still i am not get any idea about this task. pls help me............

 


MandyKoolMandyKool

Hi,

 

Only one field (checkbox) will satisfy your requirement.

You can have a field called as "Present"(checkbox) on your object. If the field is unchecked it means "Absent".

 

Then you can use "Radio buttons" on your page; so user will be able to select either of the options. In order to achieve this you can use <apex:selectOptions> and <apex:selectRadio> tags.

 

in this case you will not require any validation :) . If you can search on developer force, definately you will find a code to display the radio buttons on page or you can refer the "VF Page Developers" guide.

 

Hope this will help you!! 

SATZSATZ

Thanks for your reply kulkarni.

 

But my client must be want two checkbox coloumn in page.What should i do for this?Give me any solution ...

 

Thanks 

 

Sathish...

New_DeveloperNew_Developer

Iam having the similar requirement. DId u find the solution for this ?? please let m eknow.

 

Thanks