• sagar@sfdc
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies

hi,

 

How to mention or provide limit(range of years) of years in visualforce page for <apex:inputfield> date type datafield.

 

 

thanks

sagar

how to store the multiple values selected in selectlist  for local variable or list in apex controller  this is the code

 

<apex:selectList styleclass="textboxreddrop" size="4" multiselect="true"
                                id="Activities" value="{!activity}">
                                <apex:selectOptions value="{!SOption2s}" />
                            </apex:selectList>

 

controller///////////

public String activity{get;set;}

public List<SelectOption> getSOption2s()
    {
        List<SelectOption> options = new List<SelectOption>();
      
        //options.add(new SelectOption('None','--None--'));        
        Schema.DescribeFieldResult fieldResult = ACT_Interest__c.ORG_CSI_Tags__c.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        for(Schema.PicklistEntry p : ple)
        options.add(new SelectOption(p.getValue(), p.getValue()));
         
        return options;
    }

 

hi,

 

vl javascript work on pageblocksectionitems , i added validations for it, but it is not working ,...dis my code , ican u plz provide solution for this 

 

<apex:pageBlockSection title="Nonprofit Organization"
columns="2" id="pbset3">
<apex:pageBlockSectionItem >
<Label>Organization's Name</Label>
<apex:inputfield styleclass="textboxred" id="orgName"
onkeyup="textLimit('{!$Component.OrgName}',80);"
style="width:200px;" value="{!Actinterest.Name}" />
</apex:pageBlockSectionItem>

</apex:pageBlockSection>

 <apex:commandButton styleclass="submit" value="Submit" onclick="return checkvalidity('{!$Component.orgName}');"

 action="{!save}" />

 

 

 

 

<script language="javascript" type="text/javascript">
function checkvalidity()
{

if(document.getElementById("{!$Component.orgName}").value == ' ')
{
alert('please enter organization name');
return false;
}

else{
return true;

}
}
</script>


how to check the user provided credentials(password and username) are correct or incorrect .

 

this is my page /////////////////////////////

<apex:page controller="Beaconlogin" sidebar="false" showHeader="false" id="page1">
<apex:form id="form1">

<table >
          <tr>
            <td><apex:outputText value="User id" style="color:Black;font-size:16px;font-weight:bold"/></td>
            <td><apex:inputField value="{!login.User_id__c}" id="Userid2" style="color:Black;font-size:16px;font-weight:bold" /></td>
          </tr>
          <tr>
            <td><apex:outputText value="Password" style="color:Black;font-size:16px;font-weight:bold"/></td>
            <td><apex:inputsecret value="{!login.User_password__c}" id="Password2" style="color:Black;font-size:16px;font-weight:bold" /></td>
          </tr>
          <tr><td colspan="2">&nbsp;</td></tr>
          <tr><td colspan="2">&nbsp;</td></tr>
          <tr>
            <td></td>
            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <apex:commandButton value="Login" action="{!login_check}"  onclick="return logincheck()" id="Login"/></td>
          </tr>
        </table>

</apex:form>

</apex:page>

 

/////////////////////////////////controller ////////////////////////////////////

public with sharing class Beaconlogin {

 public PageReference login_check() {
   
      insert login;
       pagereference ref = new pagereference('https://c.ap1.visual.force.com/apex/ApplicationForm');
   ref.setredirect(true);
        return ref;
    }

 public Beacon_login__c login { get; set; }
    public Beaconlogin()
    {
    login= new Beacon_login__c();
    }

}

hi,

 

vl javascript work on pageblocksectionitems , i added validations for it, but it is not working ,...dis my code , ican u plz provide solution for this 

 

<apex:pageBlockSection title="Nonprofit Organization"
columns="2" id="pbset3">
<apex:pageBlockSectionItem >
<Label>Organization's Name</Label>
<apex:inputfield styleclass="textboxred" id="orgName"
onkeyup="textLimit('{!$Component.OrgName}',80);"
style="width:200px;" value="{!Actinterest.Name}" />
</apex:pageBlockSectionItem>

</apex:pageBlockSection>

 <apex:commandButton styleclass="submit" value="Submit" onclick="return checkvalidity('{!$Component.orgName}');"

 action="{!save}" />

 

 

 

 

<script language="javascript" type="text/javascript">
function checkvalidity()
{

if(document.getElementById("{!$Component.orgName}").value == ' ')
{
alert('please enter organization name');
return false;
}

else{
return true;

}
}
</script>


how to check the user provided credentials(password and username) are correct or incorrect .

 

this is my page /////////////////////////////

<apex:page controller="Beaconlogin" sidebar="false" showHeader="false" id="page1">
<apex:form id="form1">

<table >
          <tr>
            <td><apex:outputText value="User id" style="color:Black;font-size:16px;font-weight:bold"/></td>
            <td><apex:inputField value="{!login.User_id__c}" id="Userid2" style="color:Black;font-size:16px;font-weight:bold" /></td>
          </tr>
          <tr>
            <td><apex:outputText value="Password" style="color:Black;font-size:16px;font-weight:bold"/></td>
            <td><apex:inputsecret value="{!login.User_password__c}" id="Password2" style="color:Black;font-size:16px;font-weight:bold" /></td>
          </tr>
          <tr><td colspan="2">&nbsp;</td></tr>
          <tr><td colspan="2">&nbsp;</td></tr>
          <tr>
            <td></td>
            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <apex:commandButton value="Login" action="{!login_check}"  onclick="return logincheck()" id="Login"/></td>
          </tr>
        </table>

</apex:form>

</apex:page>

 

/////////////////////////////////controller ////////////////////////////////////

public with sharing class Beaconlogin {

 public PageReference login_check() {
   
      insert login;
       pagereference ref = new pagereference('https://c.ap1.visual.force.com/apex/ApplicationForm');
   ref.setredirect(true);
        return ref;
    }

 public Beacon_login__c login { get; set; }
    public Beaconlogin()
    {
    login= new Beacon_login__c();
    }

}