Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • Last Modified:

Javascript CreateScript, OnChangeScript. ValidateScript and adding a function

I am trying to add a function to a page that makes the first letter of a field a capital letter.
The script has to be embedded from with the applications screen designer.

First let me explain the screen designer.

There are 4 boxes to add field level scripting.

Custom Content - Enables you to add HTML and JavaScript content to a screen. The Custom Content is generated at the beginning of the page, so whatever you create appears first in the screen or panel.  
eg <input type=button value="Company Information" name=Test onclick="window.open('http://www.dnb.com')">

You use the normal JavaScript syntax in the CRM Field Level Scripting environment. The only difference is that you don't need to include the scripting <script></script> or <% %> tags. You can use JavaScript server-side scripts and client-side scripts.

Create Script.  This script is run on the server when the screen is being created.
eg.
if(CurrentUser.user_logon=='Admin')
{
RemoveLookup('Archive');
}

Validate Scripts.  This script is run on the server when the user clicks the Save button on the screen.
eg.
if (Values('oppo_certainty')<25 && 
Values('oppo_priority')!='Low')
{
  Valid=false;
  ErrorStr="please set the priority to Low";
}

Client-side
OnChange Script.  This script is run on the browser when the field that the script is attached to is changed by the user.
eg.
if(this.value =='Partner')
{
comp_revenue.disabled = 'true';
}

I have a function included in the custom content as illustrated below, I am just having difficulty attaching the function to the field.
I am not sure whether I include this in the custom content or to one of the fields Create/OnChange/Validate Scripts.

It will make more sense when you look at the following screenshot.

http://uk.pg.photos.yahoo.com/ph/seanm@btinternet.com/detail?.dir=ad57&.dnm=2cf8re2.jpg&.src=ph

Many thanks,

Mim
0
MimUK
Asked:
MimUK
  • 3
  • 3
1 Solution
 
radevoCommented:
> I am trying to add a function to a page that makes the first letter of a field a capital letter.

My question is why?  If the answer is because the server side needs to work with a first letter uppercased value, then the answer to your question is 'process the field value in the Validate script'.

Why? Because a user could submit information to your server in a way that totally bypasses your input form and onchange script.  Users typically do this by browsing to a URL with the field values passed as GET parameters, i.e. myForm.html?lastname=lowercase smith&first=joebob.

Your server side script might have to affect the input parameters and look something like

function Capitalize() {
.....
}
Values('FirstName') = Capitalize(Values('FirstName'))


0
 
MimUKAuthor Commented:
Thanks for your suggestion radevo.
But I get a syntax error.

If I view source here is the code near the field that requires the function. I won't include it all as it is too long.

script>
function capitalise(str) {
  var arr=str.split("");
  arr[0]=arr[0].toUpperCase();
  var s=arr.join("");
  return s;
}
</script></TD></TR><TR></TR><TR><TD  VALIGN=TOP ><SPAN ID=_Captpers_lastname class=VIEWBOXCAPTION>Last Name:</SPAN><br><SPAN ID=_Datapers_lastname class=VIEWBOX ><input type="text" CLASS=EDIT ID="pers_lastname" name="pers_lastname"  value="isaacs" maxlength=40 size=20><input type=hidden name=_HIDDENpers_lastname value="isaacs"><span CLASS=VIEWBOX><font color="blue" >*</font></span></SPAN></TD><TD  VALIGN=TOP ><SPAN ID=_Captpers_firstname class=VIEWBOXCAPTION>First:</SPAN><br><SPAN ID=_Datapers_firstname class=VIEWBOX ><input type="text" CLASS=EDIT ID="pers_firstname" name="pers_firstname"  value="Mark" maxlength=30 size=15><input type=hidden name=_HIDDENpers_firstname value="Mark"><span CLASS=VIEWBOX><font color="blue" >*</font></span></SPAN></TD><TD  VALIGN=TOP ><SPAN ID=_Captpers_salutation class=VIEWBOXCAPTION>Title:</SPAN><br><SPAN ID=_Datapers_salutation class=VIEWBOX ><SELECT class=EDIT size=1 name="pers_salutation"><OPTION Value="Dr.">Dr.</OPTION><OPTION Value="Miss">Miss</OPTION><OPTION Value="Mr." SELECTED >Mr.</OPTION><OPTION Value="Mrs.">Mrs.</OPTION><OPTION Value="Ms.">Ms.</OPTION><OPTION Value="Prof.">Prof.</OPTION><OPTION VALUE="">--None--</OPTION></SELECT><input type=hidden name=_HIDDENpers_salutation value="Mr."></SPAN></TD></TR><TR><TD  VALIGN=TOP ><SPAN ID=_Captpers_title class=VIEWBOXCAPTION>Job Title:</SPAN><br><SPAN ID=_Datapers_title class=VIEWBOX ><input type="text" CLASS=EDIT ID="pers_title" name="pers_title"  value="IT" maxlength=30><input type=hidden name=_HIDDENpers_title value="IT"></SPAN></TD><TD  VALIGN=TOP ><SPAN ID=_Captpers_department class=VIEWBOXCAPTION>Department:</SPAN><br><SPAN ID=_Datapers_department class=VIEWBOX ><input type="text" CLASS=EDIT ID="pers_department" name="pers_department"  value="" maxlength=30><input type=hidden name=_HIDDENpers_department value=""></SPAN></TD></TR><TR>
0
 
radevoCommented:
I'm unfamiliar with designing tool you are using, but it is likely creating two parts.

Part One - The HTML content sent to the browser (the web page)

Part Two - The FORM submission handlers.

Part One and Two might be done with the same file on the server, but the HTML source of the served page will never reveal the server side FORM submission handling code (the validation script).

Can you see the source of the ASP page that the 'designer' is creating?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
MimUKAuthor Commented:
Hi radevo,

<HTML><HEAD><META HTTP-EQUIV="Expires" CONTENT="Tue, 04 Dec 1993 21:29:02 GMT"><META http-equiv="Content-Type" content="text/html; charset=utf-8"><TITLE>Screens</TITLE><LINK REL="stylesheet" HREF="/crm_test/eware.css"><SCRIPT LANGUAGE="JAVASCRIPT">var topcount=0,topinterval;function RetryWriteToTop(){if(WriteToTop()||topcount>20){clearInterval(topinterval);}else{ topcount++;}}function WriteToTop(){if(name!='EWARE_HIDDEN' && parent.frames[3]&& parent.frames[3].WriteToFrame){parent.frames[3].WriteToFrame(5,'TOPBODY VLINK=#003B72 LINK=#003B72','<FORM><TABLE HEIGHT=99% WIDTH=75%><TR><TD CLASS=TOPHEADING WIDTH=60><IMG SRC=\x22/crm_test/img/Icons/Admin/Admin.gif\x22 HSPACE=0 BORDER=0 ALIGN=TOP></TD><TD CLASS=TOPCAPTION NOWRAP=\x22TRUE\x22 WIDTH=15%>Admin: </TD><TD></SELECT></TD></TR></TABLE></FORM>\n\r');return true;}else return false;}if(!WriteToTop())topinterval=setInterval(RetryWriteToTop,50);
function LoadComplete(editname){if(document.forms.length>0){var f=document.forms[0];var i=0;while (i< f.length) {e=f.elements[i];t=e.type.substr(0,6);if ((t!="hidden")&&(t!="select")&&(!e.disabled)&& ((editname=='')||(e.name==editname))){e.focus(); if(e.select)e.select(); break;};i++;};};};if (name=='EWARE_HIDDEN'){iHeight=0;if(parent.document.all["EWARE_CTIOBJECT"])iHeight=parent.document.all["EWARE_CTIOBJECT"].height;parent.document.all['EWARE_HIDDEN'].noResize=true;with(parent.document.all["SECONDSET"]){rows="70,*,0," + iHeight + ",0";if (iHeight==0){frameSpacing=0;}}}if ((name=='EWARE_MID')||(name=='EWARE_HIDDEN')){iHeight=0;if(parent.document.all["EWARE_CTIOBJECT"])iHeight=parent.document.all["EWARE_CTIOBJECT"].height;parent.document.all['EWARE_HIDDEN'].noResize=true;with(parent.document.all["SECONDSET"]){rows="70,*,0," + iHeight + ",0";if (iHeight==0){frameSpacing=0;}}}function item(order,colname,newline,rowspan,colspan,jump, jscript,createjscript,validatejscript) {this.order=order;this.colname=colname;this.newline=newline;this.rowspan=rowspan;this.colspan=colspan;this.jump=jump;this.jscript=jscript;this.createjscript=createjscript;this.validatejscript=validatejscript;};
function addItem() {var theForm=document.forms[0];var theList=theForm.collist;var length=theList.length;var colIndex=theForm.colname.selectedIndex;var colcap=theForm.colname.options[colIndex].text;var colname=theForm.colname.options[colIndex].value;var bAddIt=1;for (var i=0; i<length; i++) {    if (arr[i].colname == colname) {       bAddIt = 0;    }}if (bAddIt) {var newOption = new Option(colcap,length);theForm.collist.options[theForm.collist.length]=newOption;arr[length]=new item(length,colname,theForm.newline.value,theForm.rowspan.value,theForm.colspan.value,theForm.jump.value,theForm.jscript.value,theForm.createjscript.value,theForm.validatejscript.value);theForm.collist.selectedIndex = theList.length-1;bChanged=false;} else {   alert(colcap+' already included in list');}};
function updateItem() {var theForm=document.forms[0];if (theForm.collist.selectedIndex !=-1) {updateArrayItem(theForm.collist.selectedIndex);}}
function moveUp() {var theForm=document.forms[0];var theList=theForm.collist;var length=theList.length;var itemNo=theList.selectedIndex;if ((itemNo!=-1) && (itemNo!=0)) {var optionToMoveText=theList.options[itemNo].text;var optionToSwapText=theList.options[itemNo-1].text;theList.options[itemNo-1].text=optionToMoveText;theList.options[itemNo].text=optionToSwapText;var optionToMoveValue=theList.options[itemNo].value;var optionToSwapValue=theList.options[itemNo-1].value;theList.options[itemNo-1].value=optionToMoveValue;theList.options[itemNo].value=optionToSwapValue;theList.selectedIndex=itemNo-1;iLastField=iLastField-1;var itemToSwap=arr[itemNo-1];arr[itemNo-1]=arr[itemNo];arr[itemNo]=itemToSwap;}};
function moveDown() {var theForm=document.forms[0];var theList=theForm.collist;var itemNo=theList.selectedIndex;var length=theList.length;if ((itemNo!=-1) && (itemNo!=length-1)) {var optionToMoveText=theList.options[itemNo].text;var optionToSwapText=theList.options[itemNo+1].text;theList.options[itemNo+1].text=optionToMoveText;theList.options[itemNo].text=optionToSwapText;var optionToMoveValue=theList.options[itemNo].value;var optionToSwapValue=theList.options[itemNo+1].value;theList.options[itemNo+1].value=optionToMoveValue;theList.options[itemNo].value=optionToSwapValue;theList.selectedIndex=itemNo+1;iLastField=iLastField+1;var itemToSwap=arr[itemNo+1];arr[itemNo+1]=arr[itemNo];arr[itemNo]=itemToSwap;}};
function deleteItem() {var theForm=document.forms[0];var theList=theForm.collist;var itemNo=theList.selectedIndex;var length=theList.length;if (length==0 || itemNo==-1) return;theList.options[itemNo]=null;for (var i=itemNo; i < length; i++) {arr[i]=arr[i+1];};arr[length-1]=null;if (itemNo >= length-1)  {  itemNo=length-2;}if (itemNo!=-1) {theList.selectedIndex=itemNo;theForm.colname.value=arr[itemNo].colname;theForm.newline.value=arr[itemNo].newline;theForm.colspan.value=arr[itemNo].colspan;theForm.rowspan.value=arr[itemNo].rowspan;theForm.jump.value=arr[itemNo].jump;theForm.jscript.value=arr[itemNo].jscript;theForm.createjscript.value=arr[itemNo].createjscript;theForm.validatejscript.value=arr[itemNo].validatejscript;}iLastField=itemNo;bChanged=false;};
function copyToHiddenFields() {var theForm=document.forms[0];var theList=theForm.collist;var length=theList.length;var sColNames="";var sNewLines="";var sRowSpans="";var sColSpans="";var sJumps="";var sJScripts="";var screateJScripts="";var svalidateJScripts="";var okSave=true;if ((bChanged==true)&&(iLastField<length)) {alert('Changes have been made to the Properties. You must select Update or Add before saving');okSave=false;  }if (okSave==true) {for (var i=0; i < length; i++) {sColNames=sColNames+arr[i].colname+"\n";sNewLines=sNewLines+arr[i].newline+"\n";sRowSpans=sRowSpans+arr[i].rowspan+"\n";sColSpans=sColSpans+arr[i].colspan+"\n";sJumps=sJumps+arr[i].jump+"\n";sJScripts=sJScripts+arr[i].jscript+"";screateJScripts=screateJScripts+arr[i].createjscript+"";svalidateJScripts=svalidateJScripts+arr[i].validatejscript+"";}theForm.hiddencolnamescodes.value=sColNames;theForm.hiddennewlines.value=sNewLines;theForm.hiddenrowspans.value=sRowSpans;theForm.hiddencolspans.value=sColSpans;theForm.hiddenjumps.value=sJumps;theForm.hiddenjscript.value=sJScripts;theForm.hiddencreatejscript.value=screateJScripts;theForm.hiddenvalidatejscript.value=svalidateJScripts;return true;} else return false;};
function clearEdits() {var theForm=document.forms[0];theForm.newline.value="";theForm.colspan.value="";theForm.rowspan.value="";theForm.jump.value="";theForm.jscript.value="";theForm.createjscript.value="";theForm.validatejscript.value="";};
function updateArrayItem(arrindex) {var theForm=document.forms[0];if(arrindex !=-1){var theList=theForm.collist;var length=theList.length;var colIndex=theForm.colname.selectedIndex;var colcap=theForm.colname.options[colIndex].text;var colname=theForm.colname.options[colIndex].value;var bAddIt=1;if (colname != arr[arrindex].colname){    for (var i=0; i<length; i++) {     if (arr[i].colname == colname)      {        bAddIt=0;     }    }}if (!bAddIt) {   alert(colcap+' already included in list');   bChanged=false;   return;}arr[arrindex].colname=theForm.colname.value;arr[arrindex].newline=theForm.newline.value;arr[arrindex].colspan=theForm.colspan.value;arr[arrindex].rowspan=theForm.rowspan.value;arr[arrindex].jump=theForm.jump.value;arr[arrindex].jscript=theForm.jscript.value;arr[arrindex].createjscript=theForm.createjscript.value;arr[arrindex].validatejscript=theForm.validatejscript.value;var colIndex=theForm.colname.selectedIndex;var colText=theForm.colname.options[colIndex].text;theForm.collist.options[arrindex].text=colText;bChanged=false;};else {alert('ErrAdmFieldMustSelect');}};
var bChanged=false;
var iLastField=0;
var arr=Array();arr[0]=new item(0,"pers_lastname","1","1","1","","","","");arr[1]=new item(1,"pers_firstname","0","1","1","","","","");arr[2]=new item(2,"pers_salutation","0","1","1","","","","");arr[3]=new item(3,"pers_title","1","1","1","","","","");arr[4]=new item(4,"pers_department","0","1","1","","","","");arr[5]=new item(5,"pers_primaryuserid","1","1","1","","","","");arr[6]=new item(6,"pers_secterr","0","1","1","","","","");arr[7]=new item(7,"pers_can_we_mail","0","1","1","","","","");
var SchedWin, SelectDateWin,WebPickerNewWin,SelectPopWin,ViewWin; function user(user_displayname,user_pwdprofile,user_userid,user_primarychannelid,user_logon,user_lastname,user_firstname,user_language,user_department,user_emailaddress,user_per_admin,user_resource,user_externallogonallowed,user_primaryterritory,user_isterritorymanager,user_territoryprofile,user_per_user,user_per_product,user_per_currency,user_per_data,user_offlineaccessallowed,user_rollupto,user_per_customise,user_minmemory,user_maxmemory,user_title,user_location,user_deskid,user_per_infoadmin,user_device_machinename,user_per_solutions,user_offlinesecurity,user_istemplate,user_templatename,user_webserviceenabled,user_masterpersid,user_group,user_group_leader,user_prf) { this.user_displayname=user_displayname;this.user_pwdprofile=user_pwdprofile;this.user_userid=user_userid;this.user_primarychannelid=user_primarychannelid;this.user_logon=user_logon;this.user_lastname=user_lastname;this.user_firstname=user_firstname;this.user_language=user_language;this.user_department=user_department;this.user_emailaddress=user_emailaddress;this.user_per_admin=user_per_admin;this.user_resource=user_resource;this.user_externallogonallowed=user_externallogonallowed;this.user_primaryterritory=user_primaryterritory;this.user_isterritorymanager=user_isterritorymanager;this.user_territoryprofile=user_territoryprofile;this.user_per_user=user_per_user;this.user_per_product=user_per_product;this.user_per_currency=user_per_currency;this.user_per_data=user_per_data;this.user_offlineaccessallowed=user_offlineaccessallowed;this.user_rollupto=user_rollupto;this.user_per_customise=user_per_customise;this.user_minmemory=user_minmemory;this.user_maxmemory=user_maxmemory;this.user_title=user_title;this.user_location=user_location;this.user_deskid=user_deskid;this.user_per_infoadmin=user_per_infoadmin;this.user_device_machinename=user_device_machinename;this.user_per_solutions=user_per_solutions;this.user_offlinesecurity=user_offlinesecurity;this.user_istemplate=user_istemplate;this.user_templatename=user_templatename;this.user_webserviceenabled=user_webserviceenabled;this.user_masterpersid=user_masterpersid;this.user_group=user_group;this.user_group_leader=user_group_leader;this.user_prf=user_prf; }  var CurrentUser=new user('Sean Mimnagh','3','1','1','Admin','Mimnagh','Sean','UK','IS','','3','False','True','-2147483640','','1','True','True','True','True','True','','True','','','ACCPAC CRM System Admin','Dublin','5/234A','','','','','N','','True','','','','dd/MM/yyyy'); var hidden="hidden";</SCRIPT></HEAD><BODY onunload="if (SelectPopWin!=null) SelectPopWin.close();if (WebPickerNewWin!=null) WebPickerNewWin.close();if (SelectDateWin!=null) SelectDateWin.close();if (SchedWin!=null) SchedWin.close();if (ViewWin!=null) ViewWin.close(); "  CLASS="MAINBODY" LINK=#003B72 VLINK=#003B72 TOPMARGIN=0 LEFTMARGIN=0 onLoad="LoadComplete('');"><SPAN ID=RECENTPOPUP CLASS="RECENTPOPUP"></SPAN><SPAN ID=NEWPOPUP CLASS="NEWPOPUP"></SPAN><SPAN ID=FINDPOPUP CLASS="NEWPOPUP"></SPAN><SCRIPT LANGUAGE="JAVASCRIPT">function GetKeys(){return "";}</SCRIPT><TABLE cellspacing=0 cellpadding=1 bordercolordark=#ffffff bordercolorlight=#ffffff width=100%><TR><TD WIDTH=4 CLASS=VFIRSTLEFTONTAB></TD><TD HEIGHT=28 NOWRAP=true WIDTH=29% CLASS=TABON>Maintain Screen Definition Person Entry Screen (ASP: PersonBoxLong)</TD><TD WIDTH=9 CLASS=VERTICALTABOFF></TD><TD CLASS=TABOFF>&nbsp;</TD></TR><TR><TD ></TD><TD ></TD><TD HEIGHT=4 CLASS=TABBOTTOMOFF></TD><TD CLASS=TABBOTTOM></TD></TR></TABLE>
<SCRIPT>document.body.style.background="#EDEDE1 url(/crm_test/img/backgrounds/topcorner.gif) top repeat-x";</SCRIPT><TABLE WIDTH=100%><TR><TD>&nbsp;</TD><TD WIDTH=99%><SPAN ID=WkRl></SPAN><TABLE WIDTH=100% COLS=2><TR><TD WIDTH=90% VALIGN=TOP><TABLE ID=_icTable WIDTH=100% CLASS=InfoContent STYLE="display:none"><TR><TD ID=_icTD></TD></TR></TABLE><FORM name=EntryForm METHOD=POST ACTION=/crm_test/eware.dll/Do?SID=169036185828049&Act=943&Mode=3&CLk=T&DeviceID=><INPUT type=hidden name="yearEntry"><INPUT type=hidden name="monthEntry"><INPUT type=hidden name="dayEntry"><input type="hidden" name="_actionid" value="943"><input type=hidden name=_HIDDEN_BEENTHERE value="943">
<CENTER><TABLE WIDTH=100% BORDER=0  CELLPADDING=0 CELLSPACING=0 RULES=NONE>

<TR><TD COLSPAN=7><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 RULES=NONE><TR><TD COLSPAN=3><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 RULES=NONE><TR><TD VALIGN=BOTTOM><IMG SRC="/crm_test/img/backgrounds/paneleftcorner.jpg" HSPACE=0 BORDER=0 ALIGN=TOP></TD><TD WIDTH=10% NOWRAP=TRUE CLASS=PANEREPEAT>Desktop HTML Screen Contents</TD><TD VALIGN=BOTTOM><IMG SRC="/crm_test/img/backgrounds/panerightcorner.gif" HSPACE=0 BORDER=0 ALIGN=TOP></TD><TD ALIGN=BOTTOM WIDTH=90% CLASS=TABLETOPBORDER >&nbsp;</TD></TR></TABLE><TD CLASS=TABLEHEADBLANK>&nbsp;</TD><TD COLSPAN=3><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 RULES=NONE><TR><TD VALIGN=BOTTOM><IMG SRC="/crm_test/img/backgrounds/paneleftcorner.jpg" HSPACE=0 BORDER=0 ALIGN=TOP></TD><TD WIDTH=10% NOWRAP=TRUE CLASS=PANEREPEAT>Properties</TD><TD VALIGN=BOTTOM><IMG SRC="/crm_test/img/backgrounds/panerightcorner.gif" HSPACE=0 BORDER=0 ALIGN=TOP></TD><TD ALIGN=BOTTOM WIDTH=90%  CLASS=TABLETOPBORDER >&nbsp;</TD> </TR></TABLE></TD></TR><TR CLASS=CONTENT><TD WIDTH=1px CLASS=TABLEBORDERLEFT><IMG SRC="/crm_test/img/backgrounds/tabletopborder.gif" HSPACE=0 BORDER=0 ALIGN=TOP></TD><TD WIDTH=50% VALIGN=TOP CLASS=SIMPLEGRIDBOLD><TABLE WIDTH=100% CLASS=VIEWBOXCAPTION><TR><TD ALIGN=CENTER CLASS=VIEWBOXCAPTION><br><SELECT Class=CustomList  size=15 name="collist"onChange="var theForm=document.forms[0];if (bChanged==true) {if (confirm (theForm.collist.options[iLastField].text+' has been changed without Update  Do you want to save these changes?')) {updateArrayItem(iLastField);}bChanged=false;}theForm.colname.value=arr[collist.selectedIndex].colname;theForm.newline.value=arr[collist.selectedIndex].newline;theForm.colspan.value=arr[collist.selectedIndex].colspan;theForm.rowspan.value=arr[collist.selectedIndex].rowspan;theForm.jump.value=arr[collist.selectedIndex].jump;theForm.jscript.value=arr[collist.selectedIndex].jscript;theForm.createjscript.value=arr[collist.selectedIndex].createjscript;theForm.validatejscript.value=arr[collist.selectedIndex].validatejscript;iLastField=collist.selectedIndex;" style="width:225px"><OPTION Value="0" SELECTED >Person  :  Last Name</OPTION><OPTION Value="1">Person  :  First</OPTION><OPTION Value="2">Person  :  Title</OPTION><OPTION Value="3">Person  :  Job Title</OPTION><OPTION Value="4">Person  :  Department</OPTION><OPTION Value="5">Person  :  Client Manager</OPTION><OPTION Value="6">Person  :  Region</OPTION><OPTION Value="7">Person  :  Can We Mail</OPTION></SELECT></TD><TD CLASS=VIEWBOXCAPTION VALIGN=CENTER><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD><A CLASS=ButtonItem HREF="javascript:moveUp()"><IMG SRC="/crm_test/img/Buttons/moveup.gif" BORDER=0 ALIGN=MIDDLE></A></TD><TD>&nbsp;</TD><TD><A CLASS=ButtonItem HREF="javascript:moveUp()"></A></TD></TR></TABLE><br><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD><A CLASS=ButtonItem HREF="javascript:moveDown()"><IMG SRC="/crm_test/img/Buttons/movedown.gif" BORDER=0 ALIGN=MIDDLE></A></TD><TD>&nbsp;</TD><TD><A CLASS=ButtonItem HREF="javascript:moveDown()"></A></TD></TR></TABLE><br></TD></TR><TR><TD ALIGN=CENTER CLASS=VIEWBOXCAPTION><b>Custom Content</b><br><textarea CLASS=EDIT name="cobj_customcontent" maxlength=200 rows=10 cols=30>&lt;script&gt;
function capitalise(str) {
  var arr=str.split(&quot;&quot;);
  arr[0]=arr[0].toUpperCase();
  var s=arr.join(&quot;&quot;);
  return s;
}
&lt;/script&gt;</TEXTAREA></TD><TD CLASS=VIEWBOXCAPTION VALIGN=CENTER>&nbsp;</TD></TR></TABLE></TD><TD WIDTH=1px CLASS=TABLEBORDERRIGHT><IMG SRC="/crm_test/img/backgrounds/tabletopborder.gif" HSPACE=0 BORDER=0 ALIGN=TOP></TD><TD WIDTH=10 VALIGN=TOP CLASS=TABLEHEADBLANK>&nbsp;</TD><TD WIDTH=1px CLASS=TABLEBORDERLEFT><IMG SRC="/crm_test/img/backgrounds/tabletopborder.gif" HSPACE=0 BORDER=0 ALIGN=TOP></TD><TD WIDTH=99% VALIGN=TOP CLASS=SIMPLEGRIDBOLD><CENTER><TABLE><TR><TD ALIGN=CENTER><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD ALIGN=RIGHT VALIGN=MIDDLE CLASS=VIEWBOX><A HREF="javascript:updateItem()" CLASS=SmallButtonItem><IMG SRC="/crm_test/img/Buttons/Edit.gif" HSPACE=0 BORDER=0 ALIGN=TOP></A></TD><TD ALIGN=LEFT VALIGN=MIDDLE CLASS=VIEWBOX>&nbsp;<A HREF="javascript:updateItem()" CLASS=SmallButtonItem>Update</A></TD></TR></TABLE></TD><TD ALIGN=CENTER><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD ALIGN=RIGHT VALIGN=MIDDLE CLASS=VIEWBOX><A HREF="javascript:deleteItem()" CLASS=SmallButtonItem><IMG SRC="/crm_test/img/Buttons/Delete.gif" HSPACE=0 BORDER=0 ALIGN=TOP></A></TD><TD ALIGN=LEFT VALIGN=MIDDLE CLASS=VIEWBOX>&nbsp;<A HREF="javascript:deleteItem()" CLASS=SmallButtonItem  ONFOCUS="if (event && event.altKey) click();" ACCESSKEY="D" ><FONT STYLE="text-decoration:underline">D</FONT>elete</A></TD></TR></TABLE></TD><TD ALIGN=CENTER><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD ALIGN=RIGHT VALIGN=MIDDLE CLASS=VIEWBOX><A HREF="javascript:addItem()" CLASS=SmallButtonItem><IMG SRC="/crm_test/img/Buttons/new.gif" HSPACE=0 BORDER=0 ALIGN=TOP></A></TD><TD ALIGN=LEFT VALIGN=MIDDLE CLASS=VIEWBOX>&nbsp;<A HREF="javascript:addItem()" CLASS=SmallButtonItem>Add</A></TD></TR></TABLE></TD><TD ALIGN=CENTER><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD ALIGN=RIGHT VALIGN=MIDDLE CLASS=VIEWBOX><A HREF="javascript:clearEdits()" CLASS=SmallButtonItem><IMG SRC="/crm_test/img/Buttons/clear.gif" HSPACE=0 BORDER=0 ALIGN=TOP></A></TD><TD ALIGN=LEFT VALIGN=MIDDLE CLASS=VIEWBOX>&nbsp;<A HREF="javascript:clearEdits()" CLASS=SmallButtonItem  ONFOCUS="if (event && event.altKey) click();" ACCESSKEY="l" >C<FONT STYLE="text-decoration:underline">l</FONT>ear</A></TD></TR></TABLE></TD></TR></TABLE><br><TABLE CLASS=VIEWBOXCAPTION><TR><TD colspan=2>Field:</TD></TR><TR><TD colspan=2><SELECT name="colname" CLASS="EDIT" OnChange="bChanged=true;"><OPTION value="pers_phoneareacode" >
Person  :  Area Code</OPTION><OPTION value="pers_emailaddress" >
Person  :  Business E-mail</OPTION><OPTION value="pers_can_we_mail" >
Person  :  Can We Mail</OPTION><OPTION value="pers_primaryuserid" >
Person  :  Client Manager</OPTION><OPTION value="pers_companyid" >
Person  :  Company</OPTION><OPTION value="pers_phonecountrycode" >
Person  :  Country Code</OPTION><OPTION value="pers_createdby" >
Person  :  Created By</OPTION><OPTION value="pers_createddate" >
Person  :  Created Date</OPTION><OPTION value="pers_department" >
Person  :  Department</OPTION><OPTION value="pers_faxareacode" >
Person  :  Fax Area Code</OPTION><OPTION value="pers_faxcountrycode" >
Person  :  Fax Country Code</OPTION><OPTION value="pers_faxnumber" >
Person  :  Fax Number</OPTION><OPTION value="pers_firstname" >
Person  :  First</OPTION><OPTION value="pers_gender" >
Person  :  Gender</OPTION><OPTION value="pers_title" >
Person  :  Job Title</OPTION><OPTION value="pers_lastname" SELECTED >
Person  :  Last Name</OPTION><OPTION value="pers_mailrestriction" >
Person  :  Mail Restriction</OPTION><OPTION value="pers_middlename" >
Person  :  Middle</OPTION><OPTION value="pers_phonenumber" >
Person  :  Number</OPTION><OPTION value="pers_secterr" >
Person  :  Region</OPTION><OPTION value="pers_source" >
Person  :  Source</OPTION><OPTION value="pers_status" >
Person  :  Status</OPTION><OPTION value="pers_suffix" >
Person  :  Suffix</OPTION><OPTION value="pers_channelid" >
Person  :  Team</OPTION><OPTION value="pers_salutation" >
Person  :  Title</OPTION><OPTION value="pers_titlecode" >
Person  :  Title Code</OPTION><OPTION value="pers_updatedby" >
Person  :  Updated By</OPTION><OPTION value="pers_updateddate" >
Person  :  Updated Date</OPTION><OPTION value="pers_uploaddate" >
Person  :  Upload Date</OPTION><OPTION value="pers_website" >
Person  :  Website</OPTION></SELECT></TD></TR><TR><TD>Position:</TD><TD>Hyperlink to:</TD></TR><TR><TD><SELECT class=EDIT size=1 name="newline" onChange="bChanged=true;"><OPTION Value="0">Same Line</OPTION><OPTION Value="1" SELECTED >New Line</OPTION><OPTION VALUE=""></OPTION></SELECT></TD><TD><SELECT class=EDIT size=1 name="jump" onChange="bChanged=true;"><OPTION Value="businesscal">Business Calendar</OPTION><OPTION Value="callback">Call Back</OPTION><OPTION Value="callsummary">Call Summary</OPTION><OPTION Value="campaigns">Campaigns</OPTION><OPTION Value="channel">Team</OPTION><OPTION Value="communication">Communication</OPTION><OPTION Value="currency">Currency</OPTION><OPTION Value="custom">Custom Jump</OPTION><OPTION Value="exclude">Exclude</OPTION><OPTION Value="forecasthistory">View Forecast History</OPTION><OPTION Value="gotthrough">Got Through</OPTION><OPTION Value="lead">Lead</OPTION><OPTION Value="leadoppomap">Lead to Oppo Map</OPTION><OPTION Value="leadprogress">Lead Progress</OPTION><OPTION Value="library">Library</OPTION><OPTION Value="makecalls">Make Outbound Call</OPTION><OPTION Value="notes">Notes</OPTION><OPTION Value="oppoprogress">Opportunity Progress</OPTION><OPTION Value="orderquote">OrderQuote</OPTION><OPTION Value="pricinglist">Pricing List</OPTION><OPTION Value="prodfamily">Product Family</OPTION><OPTION Value="product">Product</OPTION><OPTION Value="replacecall">Replace Call</OPTION><OPTION Value="runblock">RunBlock</OPTION><OPTION Value="runtabgroup">Run Tab Group</OPTION><OPTION Value="sla">SLA</OPTION><OPTION Value="slasummary">SLA Summary</OPTION><OPTION Value="solnprogress">Solution Progress</OPTION><OPTION Value="solutions">Solutions</OPTION><OPTION Value="transfercall">Transfer Call</OPTION><OPTION Value="uofm">UofM</OPTION><OPTION Value="uofmfamily">UofM Family</OPTION><OPTION Value="updateforecast">Update Forecast</OPTION><OPTION Value="waveitems">Wave Activities</OPTION><OPTION Value="waves">Waves</OPTION><OPTION Value="workflow">Workflow</OPTION><OPTION Value="workflowrule">Workflow Rule</OPTION><OPTION Value="workflowstate">Workflow State</OPTION><OPTION Value="company">Company</OPTION><OPTION Value="person">Person</OPTION><OPTION Value="address">Address</OPTION><OPTION Value="opportunity">Opportunity</OPTION><OPTION VALUE="" SELECTED></OPTION></SELECT></TD></TR><TR><TD>Height:</TD><TD>Width:</TD></TR><TR><TD><SELECT class=EDIT size=1 name="rowspan" onChange="bChanged=true;"><OPTION Value="1" SELECTED >1 Row</OPTION><OPTION Value="2">2 Rows</OPTION><OPTION Value="3">3 Rows</OPTION><OPTION Value="4">4 Rows</OPTION><OPTION Value="5">5 Rows</OPTION><OPTION VALUE=""></OPTION></SELECT></TD><TD><SELECT class=EDIT size=1 name="colspan" onChange="bChanged=true;"><OPTION Value="1" SELECTED >1 Column</OPTION><OPTION Value="2">2 Columns</OPTION><OPTION Value="3">3 Columns</OPTION><OPTION Value="4">4 Columns</OPTION><OPTION Value="5">5 Columns</OPTION><OPTION VALUE=""></OPTION></SELECT></TD></TR><TR><TD>CreateScript:</TD><TD></TD></TR><TR><TD COLSPAN=2><textarea  CLASS=EDIT name="createjscript" OnChange="bChanged=true;" rows=4 cols=60 wrap=off></TEXTAREA></TD></TR><TR><TD>OnChangeScript:</TD><TD></TD></TR><TR><TD COLSPAN=2><textarea  CLASS=EDIT name="jscript" OnChange="bChanged=true;" rows=4 cols=60 wrap=off></TEXTAREA></TD></TR><TR><TD>Validate Script:</TD><TD></TD></TR><TR><TD COLSPAN=2><textarea  CLASS=EDIT name="validatejscript" OnChange="bChanged=true;" rows=4 cols=60 wrap=off></TEXTAREA></TD></TR></TABLE></TD><TD WIDTH=1px CLASS=TABLEBORDERRIGHT><IMG SRC="/crm_test/img/backgrounds/tabletopborder.gif" HSPACE=0 BORDER=0 ALIGN=TOP></TD></TR><TR HEIGHT=1><TD COLSPAN=3 WIDTH=1px CLASS=TABLEBORDERBOTTOM></TD><TD></TD><TD COLSPAN=3 WIDTH=1px CLASS=TABLEBORDERBOTTOM></TD> </TR></TABLE></TD></TR>
<br><input type="hidden" name="hiddencolnamescodes" value=""><input type="hidden" name="hiddennewlines" value=""><input type="hidden" name="hiddenrowspans" value=""><input type="hidden" name="hiddencolspans" value=""><input type="hidden" name="hiddenjumps" value=""><input type="hidden" name="hiddenjscript" value=""><input type="hidden" name="hiddenvalidatejscript" value=""><input type="hidden" name="hiddencreatejscript" value=""><input type="hidden" name="searchboxname" value="PersonBoxLong"><input type="hidden" name="screendd" value="Person"><input type="hidden" name="screentype" value="3"><input type="hidden" name="Device" value="1"><input type="hidden" name="_HIDDENIsReportSearchBox" value="">
</TABLE>
</TD><TD WIDTH=10 VALIGN=TOP><TABLE><TR><TD HEIGHT=29>&nbsp;</TD></TR></TABLE><TABLE CLASS=Button WIDTH=100><TR><TD CLASS=ButtonItem><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD WIDTH=32><A CLASS=ButtonItem ONFOCUS="if (event && event.altKey) click();" ACCESSKEY="S" HREF="javascript:if(copyToHiddenFields()==true) self.document.EntryForm.submit();"><IMG SRC="/crm_test/img/Buttons/Save.gif" BORDER=0 ALIGN=MIDDLE></A></TD><TD>&nbsp;</TD><TD></TD><TD><A CLASS=ButtonItem ONFOCUS="if (event && event.altKey) click();" ACCESSKEY="S" HREF="javascript:if(copyToHiddenFields()==true) self.document.EntryForm.submit();"><FONT STYLE="text-decoration:underline">S</FONT>ave</A></TD></TR></TABLE></TD></TR><TR><TD CLASS=ButtonItem><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD><A CLASS=ButtonItem ONFOCUS="if (event && event.altKey) click();" ACCESSKEY="C" onClick="self.close();" HREF=""><IMG SRC="/crm_test/img/Buttons/Cancel.gif" BORDER=0 ALIGN=MIDDLE></A></TD><TD>&nbsp;</TD><TD><A CLASS=ButtonItem ONFOCUS="if (event && event.altKey) click();" ACCESSKEY="C" onClick="self.close();" HREF=""><FONT STYLE="text-decoration:underline">C</FONT>ancel</A></TD></TR></TABLE></TD></TR><TR><TD CLASS=ButtonItem><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD><A CLASS=ButtonItem ONFOCUS="if (event && event.altKey) click();" ACCESSKEY="H" TARGET=EWARE_HELP onClick="javascript:var s; var sOpener;  try{    sOpener = '';    while(eval(sOpener + 'opener') != null){      sOpener = sOpener + 'opener.';   }  } catch(e){s = '';}    s = sOpener + 'parent.frames[3].location';  try{  if (eval(s) == null || typeof(eval(s)) == 'undefined'){ s = '';}    } catch(e){s = '';}  if (s.length == 0)s = 'Main Menu/'; else {if (eval(s).toString().toUpperCase().indexOf('ADMIN') > -1) {s = 'ADMINISTRATION/';} else {s = 'Main Menu/';}  } window.open('/crm_test/help/' + s + 'helpcontents1.htm', 'HELPWIN','scrollbars=yes,toolbar=yes,menubar=no,resizable=yes,top=200, width=600,height=400');"><IMG SRC="/crm_test/img/Buttons/help.gif" BORDER=0 ALIGN=MIDDLE></A></TD><TD>&nbsp;</TD><TD><A CLASS=ButtonItem ONFOCUS="if (event && event.altKey) click();" ACCESSKEY="H" TARGET=EWARE_HELP onClick="javascript:var s; var sOpener;  try{    sOpener = '';    while(eval(sOpener + 'opener') != null){      sOpener = sOpener + 'opener.';   }  } catch(e){s = '';}    s = sOpener + 'parent.frames[3].location';  try{  if (eval(s) == null || typeof(eval(s)) == 'undefined'){ s = '';}    } catch(e){s = '';}  if (s.length == 0)s = 'Main Menu/'; else {if (eval(s).toString().toUpperCase().indexOf('ADMIN') > -1) {s = 'ADMINISTRATION/';} else {s = 'Main Menu/';}  } window.open('/crm_test/help/' + s + 'helpcontents1.htm', 'HELPWIN','scrollbars=yes,toolbar=yes,menubar=no,resizable=yes,top=200, width=600,height=400');"><FONT STYLE="text-decoration:underline">H</FONT>elp</A></TD></TR></TABLE></TD></TR></TABLE></FORM></TD></TR></TABLE></BODY></HTML>
0
 
radevoCommented:
Yikes! Sorry, I can't go any further from here.
0
 
MimUKAuthor Commented:
Just to close the thread.
I used the following code to check case

<script>
function checkCase(x)
{
  var keyLockx = x.substr(0,1).toLowerCase()+x.substr(1).toUpperCase()
  if (x == x.toUpperCase()||x == x.toLowerCase()||x==keyLockx)
  {
    x = x.substr(0,1).toUpperCase()+x.substr(1).toLowerCase();
    return x;
  }
  else
  {
    return x;
  }
}
</script>


and assigned this.value= checkCase(this.value); to the field

Many thanks
0
 
GranModCommented:
Closed, 250 points refunded.

GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now