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
UmmiUmmi 

Field as a Mandatory using javascript?

<div class="new_row">
                            <div class="col-md-4" >
                                <apex:outputLabel for="mobilePhone" value="{!$ObjectType.Contact.fields.MobilePhone.Label}" />
                            </div>
                            <div class="col-md-8" >
                                <apex:inputField styleClass="textfield" value="{!contact.MobilePhone}" id="mobilePhone"  onkeypress='return event.charCode >= 48 && event.charCode <= 57' />
                            </div>
                        </div>
Friends I need to do This field as a Mandatory when mobile is Blank?
I nned to display the message under Field In redmark
SandhyaSandhya (Salesforce Developers) 
Hi,

Please refer below links which has some sample examples for the same.

http://stackoverflow.com/questions/21449608/make-a-field-mandatory-using-javascript
 
http://salesforce.stackexchange.com/questions/4499/how-to-make-field-required-via-javascript
 
Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
 
Thanks and Regards
Sandhya