Thanks to @anmrk, I read this article and it was very helpful.
I solved it by validating the fields in the APEX controller
when I do the upseart
operation, So the fields actually aren't required but in the upsert function
if there's any field that equals null I display a message.
Otherwise, I didn't use this validation in the search
operation so it went will.
public void update_serial(){
if(serial.Type__c != null && serial.Year__c != null && serial.Current__c != null .....){
try{
upsert serial;
serial = new Serial__c();
}catch(Exception e){
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO, e.getmessage() ));
}
}else{
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO, 'All fields are required !!' ));
}
}
And about the visualforce page, I used a stylesheet to make the fields looks required.