You need to sign in to do that
Don't have an account?
mac admin
How to change the manually entered data i a text field as i required
Hi everyone,
-I want to enter the date manually in a text field (10chr). I want to validate it as the date formate as below _ _/_ _/_ _ _ _.
Can anyone help me over here.
thanks in advance.
Regards,
mac.
-I want to enter the date manually in a text field (10chr). I want to validate it as the date formate as below _ _/_ _/_ _ _ _.
Can anyone help me over here.
thanks in advance.
Regards,
mac.
DATEVALUE( "YYYY-MM-DD" )
You can write validation rule on your object so that if the date is other than _ _/_ _/_ _ _ _. This format you throw an error saying date should be in below above format.
Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
Thanks and Regards
Sandhya
public class dateinput {
public integer day{set;get;}
public list<Opportunity > op{set;get;}
public string name{set;get;}
public string stage{set;get;}
public integer month {set;get;}
public integer year{set;get;}
public date input{set;get;}
public dateinput(){
op=new list<Opportunity>();
}
public void input(){
input=date.newinstance(year,month,day);
Opportunity p=new Opportunity();
p.Name=name;
p.StageName=stage;
p.CloseDate=input;
op.add(p);
insert op;
}
}
vf page
<apex:page controller="dateinput" docType="HTML-5.0" >
<apex:form>
<apex:pageBlock> <apex:pageBlockButtons>
<apex:commandButton value="save" action="{!input}" />
</apex:pageBlockButtons>
<apex:pageBlockSection columns="2">
<apex:outputLabel value="opp name"></apex:outputLabel>
<apex:inputText value="{!name}" />
<apex:outputLabel value="opp stage"/>
<apex:inputText value="{!stage}" />
<apex:outputLabel value="opp closedate"/>
<apex:input type="date" value="{!input}" />
</apex:pageBlockSection>
</apex:pageBlock>
do like this
Can we seperate the numbers with '/' while entering the value in the field.
I suggest you use date field instead of text field which has all standard properties you are mentioning.
Thanks and Regards
sandhya