• Jimmy Trinh
  • NEWBIE
  • 20 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hi, I am trying to fix the styling of a lookup field.  I am trying to make it wider but it keeps making the lookup icon wider as well. If you see the image below:

User-added image

I want to be able to close that gap between the icon and the actual text field.  If i click the area between the two it opens the lookup window, so I assume it is just making the clickable area larger but not the actual icon.
Hi in my Controller Extension I have a save method that will insert the record and then calls a PageReference method to redirect the page to a thank you page only if the save was successful. I have my code below and and input or assistance will be helpful.
   

    public void saveObject(){
        if(!NAME)
            checkReqName();
        if(!EMAIL)
            ValidateEmail();
        if(!EMPLOYID)
            checkEmpId();
        if(NAME && EMAIL && EMPLOYID){
            myTask.Status__c = 'New';
            insert myTask;
            myTask = null;
            NAME = false;
            EMAIL = false;
            EMPLOYID = false;
            thankYou();
        }
    }
    
    public PageReference thankYou(){
        System.debug('Entered page redirect');
        PageReference thankYouPage = Page.ThankYou;
        thankYouPage.setRedirect(true);
        return thankYouPage;
    }
Hi,

I am trying to set up a validation method when the user finishes typing and leaves the inputText.  I am grabbing that input and passing it to the controller extension and then grab a list of all the contact's emails and comparing it to the input to see if there is a match.  When I press the submit button to save a record, the apexclass will go into the validation method.  It just won't enter the method using onblur for some reason.  I am just wondering if there are any clues to as why this may be?

Also this messes up with some of the fields I am rerendering, even though email is not a condition in the rerender statement things will not show up unless I type an email.

Below is the javascript calling the validation method within the apex class:
    <script type="text/javascript">
        function getEmail(selectedValue){
            alert('Inside the javascript the email is: ' + selectedValue.value);
            ValidateEmail(selectedValue.value);
            return false;
        }    
    </script>

Below here is the inputText line with the onblur method:
<apex:inputText value="{!emailid}" styleClass="form-control" style="text-align: left;width:45%" required="true" onblur=" getEmail(this);" />
        <apex:actionFunction action="{!ValidateEmail}" name="ValidateEmail">        
            <apex:param id="emailid" name="emailid" value="" assignTo="{!emailid}"/> 
        </apex:actionFunction>  

Then below is the method within the apex class:
public void ValidateEmail(){
        System.debug('Just entered ValidateEmail');
        List<Contact> contactList = [SELECT Email FROM Contact];
        String tmp = Apexpages.currentPage().getParameters().get('emailid');
        Boolean match = false;
        
        for(Contact c: contactList)
        {
            if(emailid == c.Email){
                System.debug('There is a match');
                System.debug('tmp email: ' + tmp);
                System.debug('emailid: ' + emailid);
                System.debug('list email: ' + c.Email);
                match = true;
                break;
            }
        }
        if(match == false){
            System.debug('There is no match');
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL, 'Email not in database please enter valid email');        
        }
    }

Thanks!
Hi, I am trying to fix the styling of a lookup field.  I am trying to make it wider but it keeps making the lookup icon wider as well. If you see the image below:

User-added image

I want to be able to close that gap between the icon and the actual text field.  If i click the area between the two it opens the lookup window, so I assume it is just making the clickable area larger but not the actual icon.