Avatar of prumery
prumeryFlag for United States of America

asked on 

DDL value added from client side causing required field validator to fire.

I have a popup window that allows you to add new values to a DDL on the parent page.  The javascript code adds the new value to the ddl, but when I try to save the values to the database the required field validator fires as if there was nothing selected.  I'm guessing this is because the vale in the DDL is not on the server?  What is the best way to do this?  Do I need to validate the page a different way?

I'm using asp.net 2.0 and vb.net in a IE 7 browser.
here is the function on the parent
function fnUpdateAfterAddVendor(arr){ 
 
var Combo = document.getElementById("ctl00$middleContent$ddlVendor");
 Combo.options[0] = new Option(arr[0],arr[1]);       
Combo.options.selectedIndex = 0;
Combo.setAttribute("Vendor", arr[0]);
Combo.setAttribute("VendorID", arr[1]);
}
function on child
function Done(arr) { 
    window.opener.fnUpdateAfterAddVendor(arr);
    window.close(); 
}

Open in new window

ASP.NETJavaScriptVisual Basic.NET

Avatar of undefined
Last Comment
bui_trung_hieu
Avatar of bui_trung_hieu
bui_trung_hieu
Flag of Viet Nam image

What do you mean with "the required field validator" ? You use javascript validator or .NET validator ?

Please send me your rendered HTML source and I will try to find out where your problem comes from (javascript or smt else) because your "fnUpdateAfterAddVendor" functiong runs well. You can see it in the code below.

Here, I open a new window, add value to parent's select box, and when i submit form in the parent window, it can alert correct select box's value.

<html>
<body>
<script type="text/javascript">
function fnUpdateAfterAddVendor(arr){ 
 
var Combo = document.getElementById("ddlVendor");
 Combo.options[0] = new Option(arr[0],arr[1]);       
Combo.options.selectedIndex = 0;
Combo.setAttribute("Vendor", arr[0]);
Combo.setAttribute("VendorID", arr[1]);
}
 
function Done(arr) { 
    window.opener.fnUpdateAfterAddVendor(arr);
    window.close(); 
}
 
arr = new Array();
arr[0] = "Saab";
arr[1] = "Volvo";
if (window.opener) {
	 Done(arr);
}else{
	window.open(this.location, 'aaa');
}
</script>
<form action="" method="post" onSubmit="javascript: alert(document.getElementById('ddlVendor').value);return(false);">
<select id="ddlVendor">
 
</select>
<input type="submit" value="Submit">
</form>
</body>
</html>

Open in new window

Avatar of prumery
prumery
Flag of United States of America image

ASKER

i'm using a NET validator. The problem i have is when i try to save the form after I add a new value from the child form.  I click the save button and the required field validator throws the missing value message.

I have added the view source as you requested.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><link href="../App_Themes/IDPlans/default.css" type="text/css" rel="stylesheet" /><title>
	Work Order Details
</title><link href="/RemotePropertyManager/WebResource.axd?d=5jnYgLQZoXUFV3SvzixbQLiMv3cgEKPw8854HtX_83WJP07GZTKOaeewiHY4VE4bR5u1yH3lelOTY9GG2n6j7A2&amp;t=633455829180000000" type="text/css" rel="stylesheet" /></head>
<body style="background-color: white">
    <form name="aspnetForm" method="post" action="WorkOrderdetail.aspx?LogMaintID=192" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">
<div>
<input type="hidden" name="ctl00_middleContent_ToolkitScriptManager1_HiddenField" id="ctl00_middleContent_ToolkitScriptManager1_HiddenField" value="" />
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="zMtbJZ4h3WZql0V2DybgggP8c0nOm6CvhKITuU38VmtFj+hJlMx5eHLf7+sCPmcEuaRspy5aJNjGo5AokETrYnNrCoq72McezNZdXQeb69JUNUPyhoUZIdiMfgLd7GJy9tbLS4qEBKCiZA2i7yn9437WPP246Fusvz7vtD5P+5m4AmwXeY8ORrp8GowIfjWP9Lk8J/wp4+XXR3U/3D2zb3Ysy6CceNLj5tvtVTnwDZqPfswTkr5ereiVsJNvg6pH1XsW3JugEtG2oOwSJwS1QA1ju/RoVDQqYgu/N7nG880Za6aQ4jI0FcP1uL4zKJHFYgKgs7CmfAfpcYvObim1qCuYPVV1xHWYy1kUIHv6ZEQy9M68AjmxyALd51s3LaDQLjLj6S5fMlTRhVP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KeDqi3dQYTp2VwEFySs64+fwg6plG9cdfgc5WOR9qGRhinv/HQaxLg3UOviOSfl4e3W8kl7oU5ejkm1A+uzyIU07Nq0DOQ0Whut2ZmJBAozplgs8cPJcF3dHVYi+/tzMldibZGFYNPb40YlhWmaUhFe7RPrX/Wg5/ceJf/2gK43Cn6uZIWT/ERYmNDiZMgPeDfK28RrhG/GFtG/A5BQLeQ9nC+VEefENGUrp9k4CQ8zQnxm4a8HygP4KHrLBlIA0gWmgdpH+RBoPF3tSw==" />
</div>
 
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['aspnetForm'];
if (!theForm) {
    theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>
 
 
<script src="/RemotePropertyManager/WebResource.axd?d=m-AnF61v3wg2B_B4IlQ4bw2&amp;t=633507686360027089" type="text/javascript"></script>
 
 
<script src="/RemotePropertyManager/ScriptResource.axd?d=nR3JpW7hn1mz1LU_QUB7y3Jd-OiEYki_MuiHRb3NEGy7B4b9NH0RIi5Y_AMrFfS4B4TjkqeHxmuKqhSYCnj8Mw2&amp;t=633507686360027089" type="text/javascript"></script>
<script src="/RemotePropertyManager/ScriptResource.axd?d=vETVcr-nUlLd10OHsrPZWjG1-jnxm02S0KvXe79Xp4VTLhqN6UK2Jfj_MtT383_Iwwz-5OFbOOUam4__qxnjE9EiZKaUZtLBoyVz30m6BHc1&amp;t=633450185871731478" type="text/javascript"></script>
<script src="/RemotePropertyManager/ScriptResource.axd?d=vETVcr-nUlLd10OHsrPZWjG1-jnxm02S0KvXe79Xp4VTLhqN6UK2Jfj_MtT383_Iwwz-5OFbOOUam4__qxnjE1dxKmEIUslywKu5pAnyu2NSRK7befblmGnXhpuecgK40&amp;t=633450185871731478" type="text/javascript"></script>
<script src="/RemotePropertyManager/Log/WorkOrderdetail.aspx?_TSM_HiddenField_=ctl00_middleContent_ToolkitScriptManager1_HiddenField&amp;_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d1.0.11119.20010%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3af115bb7c-9ed9-4839-b013-8ca60f25e300%3ae2e86ef9%3aa9a7729d%3a9ea3f0e2%3a9e8e87e9%3a1df13a87%3a4c9865be%3aba594826%3a507fcf1b%3ac7a4182e%3a83b0cef6" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function WebForm_OnSubmit() {
null;if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</script>
 
        <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%">
            <tr>
                <td colspan="2">
                   <table style="width: 100%">
                        <tr>
                            <td>
                 <img alt="home" src="../App_Themes/IDPlans/images/header_logo.gif" width="424" height="75"/></td>
                            <td align="right" valign="bottom">
                                        <span id="ctl00_Label1" style="display:inline-block;width:200px;">Welcome, Patrick Rumery</span>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" colspan="2">
                                <input type="button" name="ctl00$WO" value="Work Orders" onclick="javascript:__doPostBack('ctl00$WO','')" id="ctl00_WO" class="buttonGR" style="font-size:XX-Small;" />
                                <input type="button" name="ctl00$AB" value="Address Book" onclick="javascript:__doPostBack('ctl00$AB','')" id="ctl00_AB" class="buttonGR" style="font-size:XX-Small;" />
                                <input type="button" name="ctl00$btnChangePassword" value="Change Password" onclick="javascript:__doPostBack('ctl00$btnChangePassword','')" id="ctl00_btnChangePassword" class="buttonGR" style="font-size:XX-Small;" />
                                
                                <!--IRA MONKO	4/20/2005	SUPPORT FORM -->
                                <input type="button" name="ctl00$Support" value="Support" onclick="javascript:__doPostBack('ctl00$Support','')" id="ctl00_Support" class="buttonGR" style="font-size:XX-Small;" />
                                <input type="button" name="ctl00$LogOut" value="LogOut" onclick="javascript:__doPostBack('ctl00$LogOut','')" id="ctl00_LogOut" class="buttonGR" style="font-size:XX-Small;" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
    <td colspan="3" height="5" bgcolor="#000000" ><img src="../App_Themes/IDPlans/images/spacer.gif" height="5"/></td>
  </tr>
            <tr>
                <td style="width: 10px; height: 200px;" valign="top">
                
<script language="javascript" type="text/javascript">
    function fnPopUp(url, iHeight, iWidth, sScrolling, oRefObject)
    {
	    if (url != '')
	    {
		    var oArgs = new Object();
		    oArgs.opener = self;
		    if(oRefObject){oArgs.passedObject = oRefObject;}
		    var sStyle = 'scroll:no;resizable:yes;dialogWidth:' + iWidth + 'px;dialogHeight:' + iHeight + 'px;status:no;center:yes;';
		    if (sScrolling=='yes') { url=url+'&scroll=1'; }
		    return window.showModalDialog(url, oArgs, sStyle);
	    }
    }
 
    function fnPopUpScroll(url, iHeight, iWidth, sScrolling, oRefObject)
    {
	    if (url != '')
	    {
		    var oArgs = new Object();
		    oArgs.opener = self;
		    if(oRefObject){oArgs.passedObject = oRefObject;}
		    var sStyle = 'scroll:yes;resizable:yes;dialogWidth:' + iWidth + 'px;dialogHeight:' + iHeight + 'px;status:no;center:yes;';
		    if (sScrolling=='yes') { url=url+'&scroll=1'; }
		    return window.showModalDialog(url, oArgs, sStyle);
	    }
    }
 
    function fnPopUpModeless(url, iHeight, iWidth, sScrolling, oRefObject)
    {
	    if (url != '')
	    {
		    var oArgs = new Object();
		    oArgs.opener = self;
		    if(oRefObject){oArgs.passedObject = oRefObject;}
		    var sStyle = 'scroll:no;resizable:yes;dialogWidth:' + iWidth + 'px;dialogHeight:' + iHeight + 'px;status:no;center:yes;';
		    if (sScrolling=='yes') { url=url+'&scroll=1'; }
		    return window.showModelessDialog(url, oArgs, sStyle);
	    }
    }
 
    function fnPopUpWindow(url, iHeight, iWidth, sScrolling, oRefObject)
    {
	    if (url != '')
	    {
		    var oArgs = new Object();
		    oArgs.opener = self;
		    if(oRefObject){oArgs.passedObject = oRefObject;}
		    var sStyle = 'height=' + iHeight + ',width=' + iWidth + ',location=no,menubar=no,resizable=yes,status=no,toolbar=no';
		    if (sScrolling=='yes')
		    {
			    sStyle=sStyle+',scrollbars=yes';
		    }else{
			    sStyle=sStyle+',scrollbars=no';
		    }
		    window.open(url, "_blank", sStyle);
	    }
    }
 
    function fnGetDate() 
    {
	    var d;
	    if (d == "") return "";
    	
	    var s;
	    if (arguments.length < 1)
	    {
		    d = new Date();
	    }                   
	    s = (d.getMonth() + 1) + "/";            
	    s += d.getDate() + "/";                   
	    s += d.getYear();                         
	    return s;                                
    }
    </script>
<table width="170" class="plain" border="0" cellpadding="0" cellspacing="0" bgcolor="#d3d3d3">
	<tr>
	<td height="2"><img height="2" src="images/navigation/navborderTL.gif" width="4" alt="" border="0" /></td>
	<td height="2" background="images/navigation/navborderTBG.gif"><img height="2" src="images/spacer.gif" width="160" alt="" /></td>
	<td height="2" style="width: 7px"><img height="2" src="images/navigation/navborderTR.gif" width="6"></td>
	</tr>
	
	<tr>
	<td background="images/navigation/navborderLbg.gif" style="BACKGROUND-REPEAT: repeat-y; height: 20px;"><img height="2" src="images/spacer.gif" width="2" alt="" /></td>
	<td valign="top" style="height: 20px">
        
                <table class="plain" CELLPADDING="0" CELLSPACING="0" BORDER="0" width="163">
                <tr>
                    <td>
            <input type="submit" name="ctl00$leftMenu$rptMenu$ctl01$btnHome" value="Home" id="ctl00_leftMenu_rptMenu_ctl01_btnHome" class="LeftnavGR" style="WIDTH:163px;HEIGHT:24px;CURSOR:hand;" />
                    </td>
                </tr>
                <tr>
                    <td>
            <input type="submit" name="ctl00$leftMenu$rptMenu$ctl03$btnUserProfile" value="User Profile" id="ctl00_leftMenu_rptMenu_ctl03_btnUserProfile" class="LeftnavGR" style="WIDTH:163px;HEIGHT:24px;CURSOR:hand;" />
                    </td>
                </tr>
                <tr>
                    <td>
            <input type="submit" name="ctl00$leftMenu$rptMenu$ctl05$btnPropertyManagement" value="Property Management" id="ctl00_leftMenu_rptMenu_ctl05_btnPropertyManagement" class="LeftnavGR" style="WIDTH:163px;HEIGHT:24px;CURSOR:hand;" />
                    </td>
                </tr>
                <tr>
                    <td>
            <input type="submit" name="ctl00$leftMenu$rptMenu$ctl07$btnTraining" value="Training" id="ctl00_leftMenu_rptMenu_ctl07_btnTraining" class="LeftnavGR" style="WIDTH:163px;HEIGHT:24px;CURSOR:hand;" />
                    </td>
                </tr>
                <tr>
                    <td>
            <input type="submit" name="ctl00$leftMenu$rptMenu$ctl09$btnProperty" value="ID Plans Centre" id="ctl00_leftMenu_rptMenu_ctl09_btnProperty" class="LeftnavPropGR" style="WIDTH:163px;HEIGHT:24px;CURSOR:hand;" />
                    </td>
                </tr>
                <tr>
                    <td>
            <input type="submit" name="ctl00$leftMenu$rptMenu$ctl11$btnProperty" value="ID Plans Industrial." id="ctl00_leftMenu_rptMenu_ctl11_btnProperty" class="LeftnavPropGR" style="WIDTH:163px;HEIGHT:24px;CURSOR:hand;" />
                    </td>
                </tr>
                <tr>
                    <td>
            <input type="submit" name="ctl00$leftMenu$rptMenu$ctl13$btnProperty" value="ID Plans Mall" id="ctl00_leftMenu_rptMenu_ctl13_btnProperty" class="LeftnavPropGR" style="WIDTH:163px;HEIGHT:24px;CURSOR:hand;" />
                    </td>
                </tr>
                <tr>
                    <td>
            <input type="submit" name="ctl00$leftMenu$rptMenu$ctl15$btnProperty" value="ID Plans Office Park" id="ctl00_leftMenu_rptMenu_ctl15_btnProperty" class="LeftnavPropGR" style="WIDTH:163px;HEIGHT:24px;CURSOR:hand;" />
                </table>
            
	</td>
	<td background="images/navigation/navborderrBG.gif" style="BACKGROUND-REPEAT: repeat-y; width: 7px; height: 20px;"><img height="2" src="images/spacer.gif" width="2" alt="" /></td>
	</tr>
	
	<tr id="trColor" style="display:none">
	<td bgColor="#177217" height="100%" style="BACKGROUND-REPEAT: repeat-y"><img src="images/spacer.gif" border="0" width="1" height="1" alt="" /></td>
	<td bgColor="#AF8E08" height="100%" style="BACKGROUND-REPEAT: repeat-y"><img src="images/spacer.gif" border="0" width="1" height="1" alt="" /></td>
	<td bgColor="#177217" height="100%" style="BACKGROUND-REPEAT: repeat-y; width: 7px;"><img src="images/spacer.gif" border="0" width="1" height="1" alt="" /></td>
	</tr>
	
	<tr>
	<td height="2"><img height="4" src="images/navigation/navborderLB.gif" width="4"></td>
	<td height="2" background="images/navigation/navborderBbg.gif" style="BACKGROUND-REPEAT: repeat-x">
	<img height="2" src="images/spacer.gif" width="160" alt="" />
	</td>
	<td height="2" style="width: 7px"><img height="4" src="images/navigation/navborderBR.gif" width="6"></td>
	</tr>
</table>
 
                </td>
                <td style="width: 100%" valign="top" height="100%">
                   
 
<script type="text/javascript"  language="javascript">
 
    function cancelClick() {
        var label = $get('ctl00_middleContent_lblResults');
        label.innerHTML = 'Record Not Removed ' ;
    }
    function querySt(ji) {
        hu = window.location.search.substring(1);
        gy = hu.split("&");
        for (i=0;i<gy.length;i++) {
        ft = gy[i].split("=");
        if (ft[0] == ji) {
        return ft[1];
        }
        }
        }
function fnUpdateAfterAddMaterial(arr){
     location.reload(true);
 var Combo = document.getElementById("ddlMU").firstChild ;
 Combo.options[0] = new Option(arr[0],arr[1]);       
 Combo.options.selectedIndex = 0;        
}
 
function fnUpdateAfterAddVendor(arr){ 
 
var Combo = document.getElementById("ctl00$middleContent$ddlVendor");
 Combo.options[0] = new Option(arr[0],arr[1]);       
Combo.options.selectedIndex = 0;
Combo.setAttribute("Vendor", arr[0]);
Combo.setAttribute("VendorID", arr[1]);
//form1.submit();
//Combo.options.length  ;
 //alert(arr[0]);
}
                       
var previousTotal = 0; 
                        
function fnPopUp(){ 
 var ID = querySt('LogMaintID')  
window.open('../Vendor/VendorList.aspx?LogMaintID=' + ID,'CustomPopUp','width=700, height=500, menubar=yes, resizable=yes, modal=yes');
}
 
function fnMaterialPopUp(){ 
 var ID = querySt('LogMaintID')  
window.open('../Materials/MaterialList.aspx?popup=true&LogMaintID=' + ID,'CustomPopUp','width=700, height=500, menubar=yes, resizable=yes , scrollbars =yes');
}
 
function fnAddImagePopUp(WoId, ImageName){     
var ID = querySt('LogMaintID');                 
window.open('../log/WorkOrderAddImage.aspx?LogMaintID=' + ID + '&ImageName=' + ImageName ,'CustomPopUp','width=700, height=500, menubar=yes, resizable=yes');
}
 
function updateTotal(){
var grd = document.getElementById("ctl00_middleContent_grdMaterials");
 
}
 
function Add() 
{ 
    var obj = window.event.srcElement; 
    var obj1 = window.event.srcElement; 
 
    var grd;
    var tQuant; 
    var tPrice; 
 
    // clear the sum variable 
    var sum = 0; 
    var sum1 = 0; 
    grd = document.getElementById("ctl00_middleContent_grdMaterials").rows ; 
    // tBox1 = document.getElementById("gvDepartment").rows ; 
 
  //  if(obj.tagName == "INPUT" && obj.type == "text") 
   // {
        // Iterate through all the TextBoxes
 
  //      tBox = document.getElementsByTagName("INPUT"); 
    // tBox1 = document.getElementsByTagName("INPUT"); 
 
        for(i = 1; i< (grd.length) ; i++) 
        { 
           
 
            // The Number function forces the JavaScript //to recognizes the input as a number
                tQuant =                     document.getElementById("txtQuantFoot").firstChild;
                tPrice =             document.getElementById("txtPriceFoot").firstChild;
                //tQuant = grd[i].all("ctl00_middleContent_grdMaterials_ctl03_txtUnitPrice").value; //grd[i].all[3].value;
                //tPrice = grd[i].all("ctl00_middleContent_grdMaterials_ctl03_txtQuantity").value.replace('$','');//                 grd[i].all[5].value.replace('$','');
                sum += Number(tQuant.value * tPrice.value ); 
                
             
        }    
   // }
        // set the value in the total box 
      //  document.getElementById(controlid).innerText = sum; 
      document.getElementById('ctl00_middleContent_txtTotal').innerText = "$" + sum;
}
 
function materialTotalEnter(qtyField, priceField) {
    var qty = document.getElementById(qtyField);
    var price = document.getElementById(priceField);
    
    if (qty != null && price != null) {
        var q = qty.value;
        var p = price.value;
        
        if (p != '' && price != '') {
            if (!isNaN(q) && !isNaN(p)){
                previousTotal = p * q
            }
        }
    }
}
 
function updateMaterialTotal(qtyField, priceField) {
    var qty = document.getElementById(qtyField);
    var price = document.getElementById(priceField);
    
    if (qty != null && price != null) {
        var q = qty.value;
        var p = price.value;
        
        if (p != '' && price != '') {
            if (!isNaN(q) && !isNaN(p)){
                var total = document.getElementById('ctl00_middleContent_txtTotal');
                var t = total.value.replace('$', '');
                
                if (!isNaN(t)) {
                    total.value = (t - previousTotal + (p*q)).toFixed(2);
                    total.value = "$" + total.value;
                }
            }
        }
    }
}
 
</script>
 
    <script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ctl00$middleContent$ToolkitScriptManager1', document.getElementById('aspnetForm'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tctl00$middleContent$up'], [], [], 90);
//]]>
</script>
 
    <div id="ctl00_middleContent_up">
	
            <table style="width: 100%" class="plain" cellpadding="0" align="center">
                <tbody>
                    <tr>
                        <td style="background-repeat: repeat-x" colspan="2" height="41">
                            <span id="ctl00_middleContent_lblWoDetail" class="PopHd">Work Order Detail: Basic Site Plan #107677</span>
                        </td>
                        <td style="display: block" id="tdFrameHeaderIcons" valign="top" align="right" width="270">
                            <input type="image" name="ctl00$middleContent$imgSearch" id="ctl00_middleContent_imgSearch" src="../Images/icons/icoFind.gif" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$middleContent$imgSearch&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" style="border-width:0px;" />
                            <input type="image" name="ctl00$middleContent$imgPrint" id="ctl00_middleContent_imgPrint" src="../Images/icons/icoPrint.gif" onclick="window.open('../pdf/displayworkorderaspdf.aspx?LogMaintID=192&amp;SitePlanID=12120&amp;SitePlanType=Basic');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$middleContent$imgPrint&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" style="border-width:0px;" />
                            <input type="image" name="ctl00$middleContent$imgEmail" id="ctl00_middleContent_imgEmail" src="../Images/icons/icoEmail.gif" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$middleContent$imgEmail&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" style="border-width:0px;" />
                        </td>
                    </tr>
                </tbody>
            </table>
            <fieldset>
                <legend>Work Order</legend>
                <table style="width: 744px" class="plain" cellpadding="0" align="center" border="0">
                    <tbody>
                        <tr>
                            <td valign="top" nowrap="nowrap"  rowspan="1">
                                <span id="ctl00_middleContent_Label16" style="font-size:20px;">Company</span>
                            </td>
                            <td rowspan="1">
                            </td>
                            <td width="10" rowspan="1">
                            </td>
                            <td>
                            </td>
                            <td class="viewonly" colspan="2">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" rowspan="1">
                                <span id="ctl00_middleContent_Label1">Property - Type of Site Plan - Site #</span>
                                <span id="ctl00_middleContent_lblSiteInfo">ID Plans Centre - Basic</span>
                            </td>
                            <td width="10" rowspan="1">
                            </td>
                            <td>
                            </td>
                            <td class="viewonly" colspan="2">
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" nowrap="nowrap"  rowspan="2">
                                <span id="ctl00_middleContent_Label2">Property Address</span>
                            </td>
                            <td rowspan="2">
                                <span class="viewonly">
                                    <span id="ctl00_middleContent_lblPropAddress"></span>
                                </span>
                            </td>
                            <td width="10" rowspan="2">
                                <img height="1" alt="" src="../images/spacer.gif" width="1" border="0" />
                            </td>
                            <td>
                                <span id="ctl00_middleContent_Label15">Created by</span>
                            </td>
                            <td class="viewonly" colspan="2">
                                <span id="ctl00_middleContent_lblCreatedBy"></span>
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 15px">
                                <span id="ctl00_middleContent_Label14">Last Modified by</span>
                            </td>
                            <td style="height: 15px" class="viewonly" colspan="2">
                                <span id="ctl00_middleContent_lblModifiedBy">prumery 7/22/2008</span>
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 8px" width="130">
                                <span id="ctl00_middleContent_Label3">Work Order #</span>
                            </td>
                            <td style="height: 8px" id="txtLogMaintID" class="viewonly" width="200">
                                <span id="ctl00_middleContent_lblWorkOrder">192</span>
                            </td>
                            <td style="height: 8px" width="10">
                                <img height="1" src="../images/spacer.gif" width="1" border="0" />
                            </td>
                            <td style="height: 8px" width="130">
                                <span id="ctl00_middleContent_Label13">Work Order Date</span>
                            </td>
                            <td style="height: 8px">
                                <input name="ctl00$middleContent$txtDateCreated" type="text" value="3/9/2005" id="ctl00_middleContent_txtDateCreated" style="width:112px;" />
                            </td>
                            <td style="width: 1px; height: 8px">
                            </td>
                        </tr>
                        <tr>
                            <td height="20">
                                <span id="ctl00_middleContent_Label4">Item</span>
                            </td>
                            <td>
                                <select name="ctl00$middleContent$ddlItem" id="ctl00_middleContent_ddlItem">
		<option value=""></option>
		<option value="426504">Bike Rack H #426504</option>
		<option value="426505">Bike Rack H #426505</option>
		<option value="426506">Bike Rack H #426506</option>
		<option value="426507">Bike Rack H #426507</option>
		<option value="107690">Mail Box SM #107690</option>
		<option value="426477">Mail Box SM #426477</option>
		<option value="426478">Mail Box SM #426478</option>
		<option value="426487">Mail Box SM #426487</option>
		<option value="426488">Mail Box SM #426488</option>
		<option value="426479">Newspaper Stand #426479</option>
		<option value="426480">Newspaper Stand #426480</option>
		<option selected="selected" value="107677">Basic Site Plan #107677</option>
		<option value="107696">Stairs H #107696</option>
		<option value="107679">Loading Dock #107679</option>
		<option value="107680">Loading Dock #107680</option>
		<option value="107681">Loading Dock #107681</option>
		<option value="107682">Loading Dock #107682</option>
		<option value="107683">Loading Dock #107683</option>
		<option value="107684">Loading Dock #107684</option>
		<option value="107685">Loading Dock #107685</option>
		<option value="107686">Loading Dock #107686</option>
		<option value="107687">Loading Dock #107687</option>
		<option value="107688">Loading Dock #107688</option>
		<option value="107689">Loading Dock #107689</option>
		<option value="426481">Flag Pole #426481</option>
		<option value="426482">Flag Pole #426482</option>
		<option value="426475">Tenant Mailbox #426475</option>
		<option value="426476">Tenant Mailbox #426476</option>
		<option value="426483">Tenant Mailbox #426483</option>
		<option value="426484">Tenant Mailbox #426484</option>
		<option value="426485">Tenant Mailbox #426485</option>
		<option value="426486">Tenant Mailbox #426486</option>
		<option value="426489">Tenant Mailbox #426489</option>
		<option value="426490">Tenant Mailbox #426490</option>
		<option value="107691">Newspaper Stand SM #107691</option>
		<option value="107692">Newspaper Stand SM #107692</option>
		<option value="107693">Newspaper Stand SM #107693</option>
		<option value="107694">Newspaper Stand SM #107694</option>
		<option value="107695">Rooftop Ladder SM V #107695</option>
		<option value="107697">Tenant Mailbox SM #107697</option>
		<option value="426473">Bench H #426473</option>
		<option value="426474">Bench H #426474</option>
		<option value="426447">Bell #426447</option>
		<option value="426448">Bell #426448</option>
		<option value="426449">Bell #426449</option>
		<option value="426450">Bell #426450</option>
		<option value="426444">Airborne Dropbox #426444</option>
		<option value="426451">ATM #426451</option>
		<option value="426452">ATM #426452</option>
		<option value="426453">ATM #426453</option>
		<option value="426454">ATM #426454</option>
		<option value="426455">ATM #426455</option>
		<option value="426456">ATM #426456</option>
		<option value="426457">ATM #426457</option>
		<option value="426458">ATM #426458</option>
		<option value="426459">ATM #426459</option>
		<option value="426460">ATM #426460</option>
		<option value="426461">ATM #426461</option>
		<option value="426462">ATM #426462</option>
		<option value="426463">ATM #426463</option>
		<option value="426464">ATM #426464</option>
		<option value="426465">ATM #426465</option>
		<option value="426466">ATM #426466</option>
		<option value="426467">ATM #426467</option>
		<option value="426468">ATM #426468</option>
		<option value="426469">ATM #426469</option>
		<option value="426470">ATM #426470</option>
		<option value="426471">ATM #426471</option>
		<option value="426472">ATM #426472</option>
		<option value="426491">ATM #426491</option>
		<option value="426492">ATM #426492</option>
		<option value="426493">ATM #426493</option>
		<option value="426494">ATM #426494</option>
		<option value="426495">ATM #426495</option>
		<option value="426496">ATM #426496</option>
		<option value="426497">ATM #426497</option>
		<option value="426498">ATM #426498</option>
		<option value="426499">ATM #426499</option>
		<option value="426500">ATM #426500</option>
		<option value="426501">ATM #426501</option>
		<option value="426502">ATM #426502</option>
		<option value="426503">ATM #426503</option>
		<option value="426518">ATM #426518</option>
		<option value="426519">ATM #426519</option>
		<option value="0">General</option>
 
	</select>
                                <span id="ctl00_middleContent_reqItem" style="color:Red;display:none;">Please select an Item.</span>
                            </td>
                            <td>
                                <img height="1" src="../images/spacer.gif" width="1" border="0" />
                            </td>
                            <td>
                                <span id="ctl00_middleContent_Label12">Completed Date</span>
                            </td>
                            <td>
                                <input name="ctl00$middleContent$txtMaintDate" type="text" id="ctl00_middleContent_txtMaintDate" style="width:112px;" />
                            </td>
                            <td style="width: 1px">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 18px">
                                <span id="ctl00_middleContent_Label5">Vendor</span>
                            </td>
                            <td style="height: 18px">
                                <select name="ctl00$middleContent$ddlVendor" id="ctl00_middleContent_ddlVendor">
		<option value=""></option>
		<option value="16">a1 Lighting 2</option>
		<option value="35">ABC Repairs</option>
		<option value="30">another</option>
		<option value="17">Best Maintenance</option>
		<option selected="selected" value="37">Carrie's Test</option>
		<option value="49">Carrie's Test</option>
		<option value="563">God of Sod</option>
		<option value="23">Hospital Lighting</option>
		<option value="28">J Flag Repair</option>
		<option value="34">Mike's Lightpole Repairs</option>
		<option value="29">mikes gas</option>
		<option value="31">property</option>
		<option value="45">PropertyID Training</option>
		<option value="14">test vendor</option>
		<option value="54">Testing Vendor 2</option>
		<option value="48">Training Test 1</option>
		<option value="52">Vendor Master List</option>
		<option value="53">Vendor Work Order</option>
		<option value="564">vndr 4 dumpster</option>
		<option value="33">Your Favorite Company</option>
		<option value="0">General</option>
 
	</select>
                                <input type="image" name="ctl00$middleContent$imgVendor" id="ctl00_middleContent_imgVendor" src="../Images/icons/icoMagPop.gif" onclick="window.open('../vendor/vendorlist.aspx?LogMaintID=192&amp;popup=true','CustomPopUp','width=800, height=600, menubar=no, resizable=yes, scrollbars=yes');" style="border-width:0px;" />                               
                                <span id="ctl00_middleContent_reqVendor" style="color:Red;display:none;">Please Select a Vendor.</span>
                                <br />
                                <br />
                                
                            </td>
                            <td style="height: 18px">
                            </td>
                            <td style="height: 18px">
                                <span id="ctl00_middleContent_Label11">Date Invoiced</span>
                            </td>
                            <td style="height: 18px">
                                <span id="ctl00_middleContent_lblDateInvoiced"></span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span id="ctl00_middleContent_Label6">Status</span>
                            </td>
                            <td>
                                <select name="ctl00$middleContent$ddlStatus" id="ctl00_middleContent_ddlStatus">
		<option selected="selected" value="Open">Open</option>
		<option value="Waiting">Waiting for Approval</option>
		<option value="Closed">Closed</option>
		<option value="Invoiced">Invoiced</option>
		<option value="WIP">Work In Progress</option>
 
	</select>
                                <span id="ctl00_middleContent_reqStatus" style="color:Red;display:none;">Please select a status.</span>
                            </td>
                            <td>
                            </td>
                            <td>
                                <span id="ctl00_middleContent_Label10">Paid</span>
                            </td>
                            <td class="viewonly">
                                <span id="ctl00_middleContent_lblPaid">No</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span id="ctl00_middleContent_Label7">GL Code</span>
                            </td>
                            <td>
                                <input name="ctl00$middleContent$txtGLCode" type="text" id="ctl00_middleContent_txtGLCode" />
                            </td>
                            <td width="20">
                                <img alt="spacer" height="1" src="../images/spacer.gif" width="1" border="0" />
                            </td>
                            <td>
                                <span id="ctl00_middleContent_Label9">Warranty Work</span>
                            </td>
                            <td class="viewonly" valign="top">
                                <table id="ctl00_middleContent_rblIsWarranty" border="0" style="width:96px;">
		<tr>
			<td><input id="ctl00_middleContent_rblIsWarranty_0" type="radio" name="ctl00$middleContent$rblIsWarranty" value="0" checked="checked" /><label for="ctl00_middleContent_rblIsWarranty_0">No</label></td><td><input id="ctl00_middleContent_rblIsWarranty_1" type="radio" name="ctl00$middleContent$rblIsWarranty" value="1" checked="checked" /><label for="ctl00_middleContent_rblIsWarranty_1">Yes</label></td>
		</tr>
	</table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="6" height="20">
                                <span id="ctl00_middleContent_Label8">Service Requested/Completed</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="6">
                                <textarea name="ctl00$middleContent$txtMaintDescription" rows="2" cols="20" id="ctl00_middleContent_txtMaintDescription" style="width:688px;"></textarea>
                            </td>
                        </tr>
                        
                        
                    </tbody>
                </table>
                
                &nbsp;
            </fieldset>
            <fieldset>
                <legend>Materials Used</legend>
                <table cellspacing="0" cellpadding="0" width="720" align="center" border="0">
                    <tbody>
                        <tr>
                            <td>
                                
                            </td>
                        </tr>
                        <tr>
                            <td>                               
                                <div>
		<table cellspacing="0" rules="all" border="0" id="ctl00_middleContent_grdMaterials" style="border-width:0px;border-style:None;width:720px;border-collapse:collapse;">
			<tr>
				<th scope="col">Material Used</th><th scope="col">Quantity</th><th scope="col">Cost <em>Per Item</em></th><th scope="col">Remove</th>
			</tr>
		</table>
	</div>
                            </td>
                        </tr>
                        <tr>
                            <td style="padding-left: 300px" align="left">
                                Total:
                                <input name="ctl00$middleContent$txtTotal" type="text" id="ctl00_middleContent_txtTotal" readonly="readonly" size="10" value="$0.00" />
                            </td>
                        </tr>
                        <tr>
                            <td valign="middle" align="center">
                                <input type="submit" name="ctl00$middleContent$btnAddMaterial" value="ADD" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$middleContent$btnAddMaterial&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="ctl00_middleContent_btnAddMaterial" class="buttonGR" style="width:80px;" />
                                <input type="submit" name="ctl00$middleContent$btnRemoveMaterial" value="REMOVE" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$middleContent$btnRemoveMaterial&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="ctl00_middleContent_btnRemoveMaterial" class="buttonGO" style="width:80px;" />&nbsp;
                            </td>
                        </tr>
                    </tbody>
                </table>
                &nbsp;
            </fieldset>
            <fieldset>
                <legend>Work Order Image</legend>
                <table id="tblImage" class="plain" cellspacing="0" cellpadding="0" width="720" align="center"
                    border="0">
                    <tbody>
                        <tr>
                            <td align="center">
                                <br />
                                
                                <span id="ctl00_middleContent_lblRemoveImage" style="display:inline-block;color:Red;font-size:Large;width:296px;"></span>
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 78px" align="center">
                                <input type="submit" name="ctl00$middleContent$btnAddImage" value="ADD" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$middleContent$btnAddImage&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="ctl00_middleContent_btnAddImage" class="buttonGR" style="height:24px;width:80px;" />
                                <img height="1" alt="" src="../images/spacer.gif" width="10" border="0" />&nbsp;
                                <input type="submit" name="ctl00$middleContent$btnRemoveImage" value="REMOVE IMAGE" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$middleContent$btnRemoveImage&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="ctl00_middleContent_btnRemoveImage" class="buttonGO" style="height:24px;width:100px;" />
                                
                            </td>
                        </tr>
                    </tbody>
                </table>
                <span id="ctl00_middleContent_lblResults" style="display:inline-block;width:296px;"></span></fieldset>
            <table id="table1" class="plain" cellspacing="0" cellpadding="0" width="720" align="center"
                border="0">
                <tbody>
                    <tr>
                        <td style="height: 40px" align="center">
                            &nbsp;<input type="submit" name="ctl00$middleContent$btnSave" value="SAVE" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$middleContent$btnSave&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="ctl00_middleContent_btnSave" class="buttonGR" style="height:24px;width:80px;" />
                            <img height="1" src="../images/spacer.gif" width="10" border="0" />
                            <input type="submit" name="ctl00$middleContent$btnRemoveWorkOrder" value="REMOVE WORK ORDER" id="ctl00_middleContent_btnRemoveWorkOrder" class="buttonGO" style="height:24px;width:168px;" />
                            
                            
                            <div id="ctl00_middleContent_ValidationSummary1" style="color:Red;display:none;">
 
	</div>
                            
                        </td>
                    </tr>
                </tbody>
            </table>
        
</div>
 
                   </td>                
            </tr>
            <tr>
                <td colspan="2" style="height: 75px">
                    </td>
            </tr>
            <tr>
    <td colspan="3" height="20" bgcolor="#000000" ><img src="../App_Themes/IDPlans/images/spacer.gif" height="5"/></td>
  </tr>
        </table>
    
    
<script type="text/javascript">
//<![CDATA[
var Page_ValidationSummaries =  new Array(document.getElementById("ctl00_middleContent_ValidationSummary1"));
var Page_Validators =  new Array(document.getElementById("ctl00_middleContent_reqItem"), document.getElementById("ctl00_middleContent_reqVendor"), document.getElementById("ctl00_middleContent_reqStatus"));
//]]>
</script>
 
<script type="text/javascript">
//<![CDATA[
var ctl00_middleContent_reqItem = document.all ? document.all["ctl00_middleContent_reqItem"] : document.getElementById("ctl00_middleContent_reqItem");
ctl00_middleContent_reqItem.controltovalidate = "ctl00_middleContent_ddlItem";
ctl00_middleContent_reqItem.focusOnError = "t";
ctl00_middleContent_reqItem.errormessage = "Please select an Item.";
ctl00_middleContent_reqItem.display = "Dynamic";
ctl00_middleContent_reqItem.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
ctl00_middleContent_reqItem.initialvalue = "";
var ctl00_middleContent_reqVendor = document.all ? document.all["ctl00_middleContent_reqVendor"] : document.getElementById("ctl00_middleContent_reqVendor");
ctl00_middleContent_reqVendor.controltovalidate = "ctl00_middleContent_ddlVendor";
ctl00_middleContent_reqVendor.focusOnError = "t";
ctl00_middleContent_reqVendor.errormessage = "Please Select a Vendor.";
ctl00_middleContent_reqVendor.display = "Dynamic";
ctl00_middleContent_reqVendor.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
ctl00_middleContent_reqVendor.initialvalue = "";
var ctl00_middleContent_reqStatus = document.all ? document.all["ctl00_middleContent_reqStatus"] : document.getElementById("ctl00_middleContent_reqStatus");
ctl00_middleContent_reqStatus.controltovalidate = "ctl00_middleContent_ddlStatus";
ctl00_middleContent_reqStatus.focusOnError = "t";
ctl00_middleContent_reqStatus.errormessage = "Please select a status.";
ctl00_middleContent_reqStatus.display = "Dynamic";
ctl00_middleContent_reqStatus.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
ctl00_middleContent_reqStatus.initialvalue = "";
//]]>
</script>
 
<div>
 
	<input type="hidden" name="__VIEWSTATEENCRYPTED" id="__VIEWSTATEENCRYPTED" value="" />
</div>
 
<script type="text/javascript">
<!--
var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}
 
function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
// -->
</script>
        
<script type="text/javascript">
//<![CDATA[
 
document.getElementById('ctl00_middleContent_ValidationSummary1').dispose = function() {
    Array.remove(Page_ValidationSummaries, document.getElementById('ctl00_middleContent_ValidationSummary1'));
}
Sys.Application.initialize();
 
document.getElementById('ctl00_middleContent_reqItem').dispose = function() {
    Array.remove(Page_Validators, document.getElementById('ctl00_middleContent_reqItem'));
}
 
document.getElementById('ctl00_middleContent_reqVendor').dispose = function() {
    Array.remove(Page_Validators, document.getElementById('ctl00_middleContent_reqVendor'));
}
 
document.getElementById('ctl00_middleContent_reqStatus').dispose = function() {
    Array.remove(Page_Validators, document.getElementById('ctl00_middleContent_reqStatus'));
}
Sys.Application.add_init(function() {
    $create(AjaxControlToolkit.CalendarBehavior, {"id":"ctl00_middleContent_ceMaintdate"}, null, null, $get("ctl00_middleContent_txtMaintDate"));
});
Sys.Application.add_init(function() {
    $create(AjaxControlToolkit.CalendarBehavior, {"id":"ctl00_middleContent_cdDateCreated"}, null, null, $get("ctl00_middleContent_txtDateCreated"));
});
Sys.Application.add_init(function() {
    $create(AjaxControlToolkit.ConfirmButtonBehavior, {"ConfirmText":" Are you sure you want to remove the image?","OnClientCancel":"cancelClick","id":"ctl00_middleContent_cbeRemoveImage"}, null, null, $get("ctl00_middleContent_btnRemoveImage"));
});
Sys.Application.add_init(function() {
    $create(AjaxControlToolkit.ConfirmButtonBehavior, {"ConfirmText":" Are you sure you want to remove the record?","OnClientCancel":"cancelClick","id":"ctl00_middleContent_cbeRemoveWorkOrder"}, null, null, $get("ctl00_middleContent_btnRemoveWorkOrder"));
});
//]]>
</script>
</form>
</body>
</html>

Open in new window

Oh, I think you put wrong combo's id to function fnUpdateAfterAddVendor().
That id should be "ctl00_middleContent_ddlVendor" but not "ctl00$middleContent$ddlVendor". The latter is your combo's name.

That's why you can't add value to your selectbox and the validator throw missing value.

Please try it and hope it works :)

Another comment, if you use

    Combo.options[0] = new Option(arr[0],arr[1]);

the new option will replace your first option in selectbox. So if you want to add a new one, please try the code below.




Combo.options[Combo.length] = new Option(arr[0],arr[1]);       
Combo.options.selectedIndex = Combo.length-1;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of prumery
prumery
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASP or ASP.NET is server-side code. Your server runs that code and render HTML text - the only language your browser can understand. That's why when you view any page's source, you only see HTML text.

So, the validator has to be rendered to Javascript validator which you can see in "ValidatorOnSubmit" function. Nothing runs on your server. All must run in your client's browser.

About 2nd problem, "ctl00_middleContent_ddlVendor" is the control's id and "ctl00$middleContent$ddlVendor" is its name. I didn't say those names are wrong but they are not the same. And your command

       var Combo = document.getElementById("ctl00$middleContent$ddlVendor");

helps you get a element by using your control's id but not by its name.

If you want to use its name, please try document.getElementsByName().


ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo