1 Reply Latest reply on Aug 26, 2010 1:22 PM by Hodmi

    Help with submit button remove null value



        First of all I dont know much about java, but I wanted to create a submit button and I did alot of research.  I want a button that will email some pdf files I have created in LiveCycle.  So far everyting works but my code needs help.


      There are a few fields I want to be place in the body of the e-mail, but if left blank I dont want null to apear on the email subject or body.


      Here is what I have so far *this is a work around I like to konw the proper code.





      strToAddress, strCCAddress, strSubject, strMessage


      = myemail@atwork;


      = myemail@atwork;


      = "Account "+DropDownList1.rawValue+" For: " +last.rawValue +", " +first.rawValue +" " +mi.rawValue;




      (mi.rawValue ==null || mi.rawValue =="")strSubject = "Account "+DropDownList1.rawValue+" For: " +last.rawValue +", " +first.rawValue;


      = "Please " +DropDownList1.rawValue +" account for " +"\n"+first.rawValue +" " +mi.rawValue +". " +last.rawValue +"\n\n*All provisions in  have been met" +"\n\n Comments: " +com.rawValue;




      (mi.rawValue ==null || mi.rawValue =="")strMessage = "Please " +DropDownList1.rawValue +" account for " +"\n"+first.rawValue +" " +last.rawValue +"\n\n*All provisions in have been met" +"\n\n Comments: " +com.rawValue;


      :"mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + strSubject + "&body=" + strMessage,cSubmitAs:"PDF",cCharset:"utf-8"});

      //this.resolveNode("#event").submit.target = "mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + strSubject + "&body=" + strMessage;


      The 4 fields am working on are First name, last name, Mi and comments.  First and last are alwasy used, but if MI is not I dont want Null in there, with what I have above it works but its messy.  I wanted to do the same with Comments if its left blank I like for it to read "Comments: None" not null


      on the If statement I just re did the whole deal with out the  mi.rawvalue but i now that is not right way... any help would be great.