[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB.NET IE Automation - Enter Data in Web Table

Posted on 2011-05-11
3
Medium Priority
?
1,135 Views
Last Modified: 2012-05-11
Hello,

I am working on creating automation to place orders on a website.  I can get to the orders page at this time, but I cannot enter data into the order table.  I have shown my 3 most current attempts notated in the attached code.  I have also attached the source for the website.  I am manually delaying between all web page loads until I am done debuging, so all pages are fully loaded before my attempts.  

I have also attached a screen shot fromt he website.  I am about 4 hours into this now, so I have tried - just dont have the experience yet.

Thank you. screenshot.docx
<div style="position:absolute;left:0px; top:0px; width:0px; height:0px;visibility:hidden;">
</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<html>
<head>
<title>Global Service Partner Network</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<link href="/gspn/css/body.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript" SRC="/gspn/js/gspn.js"></SCRIPT> 
<SCRIPT LANGUAGE="JavaScript" SRC="/gspn/js/check.js"></SCRIPT>
<!--<SCRIPT LANGUAGE="JavaScript" SRC="/gspn/js/calendar_ms.js"></SCRIPT>-->
<SCRIPT LANGUAGE="JavaScript" SRC="/gspn/js/calendar.js"></SCRIPT>
 
<!--
<object id="calendar" data="/GSPN/gspn/common/calendar_new2.jsp" type="text/x-scriptlet" style='position:absolute;display:none;width:150;height:180;'>
</object>
 
<script language="javascript">
  function hideCalendar(){
    document.getElementById("calendar").style.display = 'none';
  }
  if (document.body != null) document.body.onmousedown=hideCalendar;
</script>
 
<script for="calendar" event="onscriptletevent(id, view)">
  if(cur_func_name!=null){
    set_cal(id,view);
	try {
      eval(cur_func_name+"("+view+");");
	} catch(e) {
	}
  }else{
    set_cal(id,view);
  }
</script>
-->
 
<IFRAME id="procFrame" name="procFrame" border=0 width=0 height=0 style='display:none'></IFRAME>
<div id='popCal' style='z-index:999; position:absolute; visibility:hidden; ridge; width:10'>
	<iframe name="popFrame" frameborder="0" scrolling="no" width=196 height=188></iframe>
</div>
<script event=onclick() for=document> 
if(popCal.style.visibility == "visible")
{
	popCal.style.visibility="hidden";
}
</script>
 
<script language="javascript"> 
 
  // for paging
  var compareIDX;
  var sortColumn = '';
  var asc_desc = 0;
 
 
 
  var page_no = 1;
  var page_view_count = 1000;
  var page_list_count = 10;
  var total_data_count = 0;
  var data_idx_1 = 0;
  var data_idx_2 = 0;
  var total_pages;
  var strPageLink = "";
  var img_space="/gspn/images/spacer.gif";
  var img_arrow="";
 
 
 
 
 
 
  var blnCompareDigit = false;
  var blnCompareDate =false;
 
  function goToPage( pageNo ){
 
    if( typeof document.all.LIST_PAGE_NO != "undefined" ){
      if( typeof document.all.LIST_PAGE_NO.length == "undefined" ){
        document.all.LIST_PAGE_NO.value = pageNo;
      }else{
        for( i=0 ; i<document.all.LIST_PAGE_NO.length ; i++ ){
          document.all.LIST_PAGE_NO[i].value = pageNo;
        }
      }
    }
 
    page_no = pageNo;
 
    preparePageIDX();
 
    makePageLink();
	
    displaySortedData();
	
    if (sortColumn != "" && typeof eval("document.all."+sortColumn) != "undefined"){
      obj = eval("document.all."+sortColumn);
      obj.src = img_arrow;
    }
 
 
  }
 
  function preparePageIDX(){
 
    data_idx_1 = (page_no-1)*page_view_count;
    data_idx_2 = data_idx_1+page_view_count;
 
    if( data_idx_1>total_data_count ) data_idx_1 = total_data_count;
    if( data_idx_2>total_data_count ) data_idx_2 = total_data_count;
 
    if( (total_data_count%page_view_count)==0 ){
      total_pages = total_data_count/page_view_count;
    }else{
      total_pages = parseInt((total_data_count/page_view_count),10) + 1;
    }
 
  }
 
  function makePageLink(){
 
    strPageLink = "";
 
    var page_idx_1 = 0;
    var page_idx_2 = 0;
 
    if( (page_no%page_list_count) != 0 ){
      page_idx_1 = parseInt((page_no/page_list_count),10)*page_list_count + 1;
      page_idx_2 = page_idx_1 + page_list_count - 1;
    }else{
      page_idx_1 = page_no - page_list_count + 1;
      page_idx_2 = page_no;
    }
 
    if( page_idx_2>total_pages ) page_idx_2 = total_pages;
 
    strPageLink = strPageLink + "<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">";
    strPageLink = strPageLink + "  <tr> ";
    strPageLink = strPageLink + "    <td class=\"pmove\">";
 
    if( page_no>1 ){
      strPageLink = strPageLink + "<a href=\"javascript:goToPage('1');\"><img src=\"/gspn/images/en/Icon_start.gif\" hspace=\"5\" align=\"absmiddle\" border=\"0\"></a>";
      strPageLink = strPageLink + "<a href=\"javascript:goToPage('"+(page_no-1)+"');\"><img src=\"/gspn/images/en/Icon_prev2.gif\" hspace=\"5\" align=\"absmiddle\" border=\"0\"></a>";
    }
 
    for( i=page_idx_1 ; i<=page_idx_2 ; i++ ){
 
      if( i==page_no ){
        if( i==page_idx_2 ){
          strPageLink = strPageLink + "<span class=\"list-data-center\"> "+i+" </span> ";
        }else{
          strPageLink = strPageLink + "<span class=\"list-data-center\"> "+i+" </span> | ";
        }
      }else{
        if( i==page_idx_2 ){
          strPageLink = strPageLink + "<a href=\"javascript:goToPage('"+i+"');\"> "+i+" </a>";
        }else{
          strPageLink = strPageLink + "<a href=\"javascript:goToPage('"+i+"');\"> "+i+" </a> | ";
        }
      }
 
    }
 
    if( page_no<total_pages ){
      strPageLink = strPageLink + "<a href=\"javascript:goToPage('"+(parseInt(page_no,10)+1)+"');\"><img src=\"/gspn/images/en/Icon_next2.gif\" hspace=\"5\" align=\"absmiddle\" border=\"0\"></a>";
      strPageLink = strPageLink + "<a href=\"javascript:goToPage('"+total_pages+"');\"><img src=\"/gspn/images/en/Icon_end.gif\" hspace=\"5\" align=\"absmiddle\" border=\"0\"></a>";
    }
 
    strPageLink = strPageLink + "    </td>";
    strPageLink = strPageLink + "  </tr>";
    strPageLink = strPageLink + "</table>";
 
  }
 
  function compare( idx , sc ){
 
    blnCompareDigit = false;
    blnCompareDate =false;
 
    compareIDX = idx;
 
 
    if( sortColumn==sc ){
      if( asc_desc & 1 ){
        listdata.sort( desc );
        asc_desc = 0;
        img_arrow ="/gspn/images/common/Icon_Lup.gif";
 
      }else{
        listdata.sort( asc );
        asc_desc = 1;
        img_arrow ="/gspn/images/common/Icon_Ldown.gif";
      }
 
    }else{
      listdata.sort( asc );
      asc_desc = 1;
      img_arrow = "/gspn/images/common/Icon_Ldown.gif";
    }
    sortColumn = sc;
 
    displaySortedData();
 
    if( typeof listdata != "undefined" && listdata.length>0 ){
      obj = eval("document.all."+sc);
      obj.src = img_arrow;
    }
 
  }
 
  function compareDigit( idx , sc ){
 
    blnCompareDigit = true;
    blnCompareDate =false;
 
    compareIDX = idx;
 
    if( sortColumn==sc ){
      if( asc_desc & 1 ){
        listdata.sort( desc );
        asc_desc = 0;
        img_arrow ="/gspn/images/common/Icon_Lup.gif";
      }else{
        listdata.sort( asc );
        asc_desc = 1;
        img_arrow ="/gspn/images/common/Icon_Ldown.gif";
      }
 
    }else{
      listdata.sort( asc );
      asc_desc = 1;
      img_arrow = "/gspn/images/common/Icon_Ldown.gif";
    }
    sortColumn = sc;
 
    displaySortedData();
 
    if( typeof listdata != "undefined" && listdata.length>0 ){
      obj = eval("document.all."+sc);
      obj.src = img_arrow;
    }
 
  }
 
  function compareDate( idx , sc ){
 
    blnCompareDigit = false;
    blnCompareDate = true;
 
    compareIDX = idx;
 
    if( sortColumn==sc ){
      if( asc_desc & 1 ){
        listdata.sort( desc );
        asc_desc = 0;
        img_arrow ="/gspn/images/common/Icon_Lup.gif";
      }else{
        listdata.sort( asc );
        asc_desc = 1;
        img_arrow ="/gspn/images/common/Icon_Ldown.gif";
      }
 
    }else{
      listdata.sort( asc );
      asc_desc = 1;
      img_arrow = "/gspn/images/common/Icon_Ldown.gif";
    }
    sortColumn = sc;
 
    displaySortedData();
 
    if( typeof listdata != "undefined" && listdata.length>0 ){
      obj = eval("document.all."+sc);
      obj.src = img_arrow;
    }
 
  }
 
  function makeDateString( strDate ){
 
    var yearData = strDate.substring( 6 , 10 );
    var monthData = strDate.substring( 0 , 2 );
    var dateData = strDate.substring( 3 , 5 );
 
    return yearData+""+monthData+""+dateData;
 
  }
 
  function asc( a , b ){
 
    var aVal = a[compareIDX];
    var bVal = b[compareIDX];
 
 
 
    if( blnCompareDigit ){
 
      aVal = aVal.replace(/(\&nbsp;)/gi, '');
      bVal = bVal.replace(/(\&nbsp;)/gi, '');
 
      if( aVal=='' && bVal=='' ){
        return 0;
      }else if( aVal=='' && bVal!='' ){
        return -1;
      }else if(  aVal!='' && bVal==''  ){
        return 1;
      }
 
      aVal = aVal.replace(/(\,)/gi, '');
      aVal = aVal.replace(/(\.)/gi, '.');
 
      bVal = bVal.replace(/(\,)/gi, '');
      bVal = bVal.replace(/(\.)/gi, '.');
 
      if( parseFloat(aVal,10) < parseFloat(bVal,10) ) return -1;
      if( parseFloat(aVal,10) == parseFloat(bVal,10) ) return 0;
      if( parseFloat(aVal,10) > parseFloat(bVal,10) ) return 1;
 
    }else if( blnCompareDate ){
 
      aVal = makeDateString( aVal );
      bVal = makeDateString( bVal );
 
      if( aVal < bVal ) return -1;
      if( aVal == bVal ) return 0;
      if( aVal > bVal ) return 1;
 
    }else{
 
      if( aVal < bVal ) return -1;
      if( aVal == bVal ) return 0;
      if( aVal > bVal ) return 1;
 
    }
 
  }
 
  function desc( a , b ){
 
    var aVal = a[compareIDX];
    var bVal = b[compareIDX];
 
    if( blnCompareDigit ){
 
      aVal = aVal.replace(/(\&nbsp;)/gi, '');
      bVal = bVal.replace(/(\&nbsp;)/gi, '');
 
      if( aVal=='' && bVal=='' ){
        return 0;
      }else if( aVal=='' && bVal!='' ){
        return 1;
      }else if(  aVal!='' && bVal==''  ){
        return -1;
      }
 
      aVal = aVal.replace(/(\,)/gi, '');
      aVal = aVal.replace(/(\.)/gi, '.');
 
      bVal = bVal.replace(/(\,)/gi, '');
      bVal = bVal.replace(/(\.)/gi, '.');
 
      if( parseFloat(aVal,10) < parseFloat(bVal,10) ) return 1;
      if( parseFloat(aVal,10) == parseFloat(bVal,10) ) return 0;
      if( parseFloat(aVal,10) > parseFloat(bVal,10) ) return -1;
 
    }else if( blnCompareDate ){
 
      aVal = makeDateString( aVal );
      bVal = makeDateString( bVal );
 
      if( aVal < bVal ) return 1;
      if( aVal == bVal ) return 0;
      if( aVal > bVal ) return -1;
 
    }else{
 
      if( aVal < bVal ) return 1;
      if( aVal == bVal ) return 0;
      if( aVal > bVal ) return -1;
 
    }
 
  }
 
  function onloadDisplay(){
    setTimeout( "initPage()" , 200 );
  }
 
  function initPage(){
    if( typeof listdata != "undefined" ) {
      total_data_count = listdata.length;
    } else {
      total_data_count = 0;
    }
  //  if( listdata.length>0 )
    goToPage(page_no);
  }
 
 
  function showMessage(message){
       var url = "/GSPN/gspn/common/GSPN_MsgPopup.jsp?message=" + message;
       var feature = "toolbar=no,location=no,directories=no,status=no,menubar=no," +
               "resizable=no,copyhistory=no,scrollbars=no,top=200,left=200,width=330,height=120";
    var w = window.open(url, "msg_popup", feature);
      w.focus();
   }
 
  function showDataprocessBar(){
    if (document.getElementById("DP_Cover") != null)
      document.getElementById("DP_Cover").style.visibility = "visible";
    if (document.getElementById("DIV_Dataprocess") != null)
    {
      document.getElementById("DIV_Dataprocess").style.visibility = "visible";
      document.getElementById("DIV_Dataprocess").focus();
    }
  }
 
  function hideDataprocessBar(){
    if (document.getElementById("DP_Cover") != null)
      document.getElementById("DP_Cover").style.visibility = "hidden";
    if (document.getElementById("DIV_Dataprocess") != null)
      document.getElementById("DIV_Dataprocess").style.visibility = "hidden";
  }
 
 
 
  // add by simple 2005.06.23
  function setFormatDate(obj){
 
    var strResult = "";
     var strDate = "";
 
     strDate = obj.value;
    strDate = removeDot(strDate);
    if(strDate.length != 8 || !numCheck(strDate)){
      //alert("Invalid date!");
      alert("Invalid date!");
      obj.focus();
      return;
    }else{
      alert("bb");
         strResult = strDate.substring(0,2)+"."+strDate.substring(2,4)+"."+strDate.substring(4,8);
        obj.value = strResult;
     }
  }
  function setFormatDate(obj, compFormat){
 
    var strResult = "";
     var strDate = "";
 
     strDate = obj.value;
     if(strDate != ""){
      strDate = removeDot(strDate);
      if(strDate.length != 8 || !numCheck(strDate)){
        //alert("Invalid date!");
        alert("Invalid date!");
        obj.focus();
        return;
      }else{
        if (compFormat == "yyyy.MM.dd"){
              strResult = strDate.substring(0,4)+"/"+strDate.substring(4,6)+"/"+strDate.substring(6,8);
           }else{
              strResult = strDate.substring(0,2)+"/"+strDate.substring(2,4)+"/"+strDate.substring(4,8);
        }
          obj.value = strResult;
       }
     }
  }
  function setFormatMonth(obj){
 
    var strResult = "";
     var strDate = "";
 
     strDate = obj.value;
    strDate = removeDot(strDate);
    if(strDate.length != 6 || !numCheck(strDate)){
      //alert("Invalid date!");
      alert("Invalid date!");
      obj.focus();
      return;
    }else{
         strResult = strDate.substring(0,2)+"."+strDate.substring(2,6);
        obj.value = strResult;
     }
  }
 
</script>
 
 
<script language="javascript"> 
//  Below script is to prevent leaving the current page without saving.
  var wasFormChanged = false;
  var ignoreFormChanged = false;
 
  function checkFormChanged(){
 
  //  alert( "wasFormChanged:"+wasFormChanged+" , ignoreFormChanged:"+ignoreFormChanged );
 
    if( !wasFormChanged ) return;
 
    if( ignoreFormChanged ){
      ignoreFormChanged = false;
      return;
    }
 
    event.returnValue = "Will you leave this page without saving changed data?";
 
  }
 
  function formChanged(){
 
    /*
    var oSrc = event.srcElement;
    var oSrcType = oSrc.type;
    var oSrcName = oSrc.name;
    alert( oSrcType + " : " + oSrcName );
    */
 
    wasFormChanged = true;
 
  }
 
  function ignoreChange( status ){
  //  alert("ignoreChange's status : "+status);
    ignoreFormChanged = status;
  }
  /**
  * bulletin popup window function.
  * by hs.Lim 2006.01.03
  */
  function asc_parts_info_showbulletin(R){
    var url = "http://service.samsungportal.com/EP/web/portal/jsp/EP_setCert_post.jsp?certid=K200406030637546411056&type=1&url=http%3A%2F%2Fnaskp.samsungportal.com%2Fkm%2Fweb%2Fsearchmanager%2FKMFNCont.jsp%3Fconid%3Da376$@$a377$@$%26SearchType%3Dall%26query%3D"+R+"%26collname%3Dnakm%26usertimezone%3D%26start_id%3D%26end_id%3D%26mode%3D2%26langid%3D%26sltSort1%3Dhitno%26sltSort2%3D%26sltSort3%3D%26recheck%3DN%26datecheck%3DN%26SrchType%3D<AND>"; // & : %26, ? : %3F, = : %3D
    window.open(url,"mybull","status=yes,toolbar=no,scrollbars=yes,width=700,height=500");
  }
 
</script>
 
<iframe id='DP_Cover' src='/GSPN/gspn/common/DP_Cover.jsp' frameborder="0" marginwidth="0" marginheight="0"  align=center valign=middle style="position:absolute; left:0px; top:0px;width:100%;height:100%;z-index:200;visibility:hidden;" allowTransparency="true"></iframe>
 
<div id="DIV_Dataprocess" align="center" style="position:absolute;  left:0px; top:0px; width:100%; height:100%; z-index:100;visibility:hidden;">
<table width="100%" height="100%" border=0>
  <tr>
   <td align=center valign=middle>
<iframe id='DP_Bar_iframe' src='/GSPN/gspn/common/DP_Bar.jsp' frameborder="0" marginwidth="0" marginheight="0" border=0 style="width:406;height:111;z-index:100;margin-right:0px;margin-bottom:0px" ></iframe>
   </td>
  </tr>
</table>
</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  <script>
    //alert("Can not create P/O! (Credit blocked)");
    //history.go(-1);
  </script>
 
 
 
 
<link href="/gspn/css/body.css" rel="stylesheet" type="text/css">
<script language="javascript"> 
 
  function beforeOpenCalendar(obj_id, idx) {
    num = document.all.DTable.rows.length;
    openCalendarArr(obj_id, num, idx)
  }
 
  function beforeOpen(idx){
    var f = document.FORM_ORDER;
    num = document.all.DTable.rows.length;
 
    if(num == 2){
      fld = "FORM_ORDER.material";
      val = f.material.value;
    }else{
      fld = "FORM_ORDER.material["+idx+"]";
      val = f.material[idx].value;
    }
 
    if(val.length != 0)
      srh = "&search=SRCH";
    else
      srh = "";
 
    url = "/GSPN/gspn/ord/popup/ORDPartSearch.jsp?parts_fld_value="+fld+"&parts_value="+val+srh;
    w=window.open(url,"part_popup",'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=no,top=150,left=200,width=700,height=530');
    w.focus();
  }
 
  function beforeOpenAlter(idx){
    var f = document.FORM_ORDER;
    num = document.all.DTable.rows.length;
 
    if(num == 2){
      fld = "FORM_ORDER.material";
      val = f.material.value;
    }else{
      fld = "FORM_ORDER.material["+idx+"]";
      val = f.material[idx].value;
    }
 
    if(val.length != 0)
      srh = "&search=SRCH";
    else
      srh = "";
 
    url = "/GSPN/gspn/ord/popup/ORDAlterPartSearch.jsp?parts_fld_value="+fld+"&parts_value="+val+srh;
    w=window.open(url,"part_popup",'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=no,top=150,left=200,width=700,height=530');
    w.focus();
  }
 
   function getCookie(name) {
		var nameOfCookie = name + "=";
		var x = 0;
		while(x <= document.cookie.length) {
			var y = (x + nameOfCookie.length);
			if(document.cookie.substring(x, y) == nameOfCookie) {
				if((endOfCookie = document.cookie.indexOf(";", y)) == -1)
					endOfCookie = document.cookie.length;
				return unescape(document.cookie.substring(y, endOfCookie));
			}
			x = document.cookie.indexOf(" ", x) + 1;
			if(x == 0)
				break;
		}
		return "";
	}
    
  function popIssueWindow(material) {
 
    if( material == 'BN96-12706A' || material == 'BN96-15402A' || material == 'BN96-12707A' || 
        material == 'BN96-15403A' || material == 'BN96-13266A' || material == 'BN96-15404A' ) {
      url = "/popup/PO_Plasma_notice.html";
      w=window.open(url,"alert_popup",'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollb  ars=no,top=80,left=200,width=700,height=370');
      w.focus();
    }
 
  }
 
  function openNotice() {
 
    //alert("Since 12/15/2010, order quantity limit has been changed to 20 per line.");
 
    if(getCookie("ORD_notice") != "done") {
 
      url = "/popup/PO_DLP_end_notice.html";
      w=window.open(url,"notice_popup",'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=no,top=80,left=200,width=600,height=320');
      w.focus(); 
    }
 
  }
 
  function checkPartNo(obj, idx) {	
	obj.value = obj.value.toUpperCase();
	var f = document.FORM_ORDER;
 
 
    var material = obj.value;
    if( material == 'BN96-12706A' || material == 'BN96-15402A' || material == 'BN96-12707A' || 
        material == 'BN96-15403A' || material == 'BN96-13266A' || material == 'BN96-15404A' ) {
 
        num = document.all.DTable.rows.length;
 
        if(num == 2){
          fld = "FORM_ORDER.material";
          val = f.material.value;
        }else{
          fld = "FORM_ORDER.material["+idx+"]";
          val = f.material[idx].value;
        }
 
        if(val.length != 0)
          srh = "&search=SRCH";
        else
          srh = "";
 
        url = "/popup/PO_Plasma_notice.html?parts_fld_value="+fld+"&parts_value="+val+srh;
        w=window.open(url,"alert_popup",'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=no,top=80,left=200,width=700,height=370');
        w.focus();
	}
 
 
	var rowCnt = document.getElementById("DTable").rows.length-1;
    if( rowCnt > 1 ) {
	  for (i = 0; i < rowCnt; i++){
        if(obj != f.material[i] && obj.value == f.material[i].value && obj.value != '') {
		  return;
		}
	  }
	}
	try {
	  document.frames['Cmp_1'].reloadDisplay();
	}
	catch(e) {
	}
  }
 
  function initPartNo() {
    try {
	  document.frames['Cmp_1'].reloadDisplay();	
	}
	catch(e) {
	}
  }
 
  function spaceTrim(str) {
    var resultVal = '';
    var tempVal = '';
    var digit = '';
    if(str != null && str != '') {
      tempVal = str;
      if (tempVal.length != 0) {
        for(var i=0; i < tempVal.length; i++) {
          digit = tempVal.charAt(i);
          if(digit != ' ')  resultVal = resultVal + digit;
        }
      }
    }
    return resultVal;
  }
 
  function beforeVerify(){
    var f = document.FORM_ORDER;
    var numrows = document.all.DTable.rows.length-1;
    var rc = 0;
    var hasNextDay = false;
 
    if(f.customer_po_number.value.length == 0){
      alert("Please input the PO No to check duplicate orders");
      f.customer_po_number.focus();
      return;
    }
    if(isSafetyStockPoNo(f.customer_po_number.value)) return;
    
    if(f.ship_to.value.length == 0){
      alert("Please select the ship-to.");
      f.ship_to.focus();
      return;
    }
 
 
 
  if(f.onetime_yn_chk[0].checked){
    if(trim(f.shipto_name.value) == ""){
      alert("Please enter name.");
      f.shipto_name.select();
      return;
    }
    if(trim(f.street.value) == ""){
      alert("Please enter address.");
      f.street.select();
      return;
    }
    if(trim(f.city.value) == ""){
      alert("Please enter city.");
      f.city.select();
      return;
    }
    if(f.state.value == ""){
      alert("Please enter region.");
      f.state.focus();
      return;
    }
    if(trim(f.postl_code.value) == ""){
      alert("Please enter zip code.");
      f.postl_code.select();
      return;
    }
    if(trim(f.contact_phone_number.value) == ""){
      alert("Please enter contact phone number.");
      f.contact_phone_number.select();
      return;
    }
  }
  if(f.onetime_yn_chk[0].checked)
    f.onetime_yn.value = "Y";
  else
    f.onetime_yn.value = "N";
 
 
  if(f.e_flag_chk[0].checked && f.email.value.length == 0){
    alert("Please input the email address");
    f.email.focus();
    return;
  }
  if(f.e_flag_chk[0].checked && f.email.value.length != 0){
    var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
    if(isValidFormat(f.email,format)){
      alert("Please input the email address");
      f.email.focus();
      return;
    }
  }
  if(f.e_flag_chk[0].checked)
    f.e_flag.value = "Y";
  else
    f.e_flag.value = "N";
 
 
  if(numrows == 0){ //no rows
    alert("Please input one or more detail items.");
    return;
  }else if(numrows == 1){ //input
    if(f.material.value.length == 0){
      alert("Please search parts.");
      f.material.focus();
      return;
    }
    temp_qty = Jtrim(f.quantity.value);
      if(temp_qty.length == 0 || temp_qty == "0"){
        alert("Incorrect order quantity!");
        f.quantity.focus();
        return;
      }else{
        f.quantity.value = temp_qty;
      }
      if(!checkNumBoolean(f.quantity.value)){
        alert("Incorrect order quantity!");
        f.quantity.focus();
        return;
      }
 
      
 
      /*
      if(f.ship_method0[0].checked){
        f.ship_method.value = "S";
      }else{
        if(f.refno.value == ""){
          alert("Input Reference (Narda/Ticket) Number");
          f.refno.focus();
          return;
        }
        
		if(f.ship_method0[1].checked){
		  f.ship_method.value = "E";
		}
		else {
		  f.ship_method.value = "N";
		}
      }
      */
      if(f.ship_method.value == ''){
        alert("Please select the Shipping Method.");
        f.ship_method.focus();
        return;
      }
      /*
      if(f.ship_method.value != 'A' && f.refno.value == ""){
        alert("Input Reference (Narda/Ticket) Number");
        f.refno.focus();
        return;
      }
      */
      
      if(f.ship_method.value == 'D8') {
        hasNextDay = true;
      }
 
      rc = 1;
    }else{ //input arr
      for(i=0; i<numrows; i++){
        if(f.material[i].value.length == 0 && f.quantity[i].value.length == 0){
          if(rc == 0){
            alert("Please input one or more detail items.");
            return;
          }
        }else{
          if(f.material[i].value.length != 0 || f.quantity[i].value.length != 0){
            if(f.material[i].value.length == 0){
              alert("Please search parts.");
              f.material[i].focus();
              return;
            }
            temp_qty = Jtrim(f.quantity[i].value);
            if(temp_qty.length == 0 || temp_qty == "0"){
              alert("Incorrect order quantity!");
              f.quantity[i].focus();
              return;
            }else{
              f.quantity[i].value = temp_qty;
            }
            if(!checkNumBoolean(f.quantity[i].value)){
              alert("Incorrect order quantity!");
              f.quantity[i].focus();
              return;
            }
 
 
            /*
            chkShipObj = eval("f.ship_method"+i);
            if(chkShipObj[0].checked){
              f.ship_method[i].value = "S";
            }else{
              if(f.refno[i].value == ""){
                alert("Input Reference (Narda/Ticket) Number");
                f.refno[i].focus();
                return;
              }
			  if(chkShipObj[1].checked){
		        f.ship_method[i].value = "E";
		      }
		      else {
		        f.ship_method[i].value = "N";
		      }
            }
            */
            if(f.ship_method[i].value == ''){
              alert("Please select the Shipping Method.");
              f.ship_method[i].focus();
              return;
            }
            /*
            if(f.ship_method[i].value != 'A' && f.refno[i].value == ""){
              alert("Input Reference (Narda/Ticket) Number");
              f.refno[i].focus();
              return;
            }
            */
            
            if(f.ship_method[i].value == 'D8') {
                hasNextDay = true;
            }
 
          }
          rc++;
        }
      }
    }
 
    //alert(hasNextDay);
    //alert(f.ship_method_accept.value);
            
    if(hasNextDay && f.ship_method_accept.value != 'Y') {
        alert("Please read the shipping agreement.");
        url = "/GSPN/gspn/ord/partorder/ORDOrderAgreement.jsp"; w=window.open(url,"part_agree_popup",'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=no,top=150,left=200,width=505,height=380');
        w.focus();
        return;
    }
 
    showDataprocessBar();
    f.rowcount.value = rc;
    f.search.value = "PO_CREATE_VERIFY";
    f.action = "ORDOrder.jsp";
    document.body.onbeforeunload=null;
    f.submit();
  }
 
  function checknum(obj){
    var val = obj.value;
    if(!numCheck(val)){
      alert("Please enter only digits");
      obj.focus();
      return;
    }
  }
  function checkNumBoolean(val){
    if(!numCheck(val)){
      return false;
    }else{
       return true;
    }
  }
 
  function checkAll(){
    var f = document.all.FORM_ORDER;
    if(f.chk_all.checked){
      checkAllNothing("FORM_ORDER", "chk", true);
    }else if(!f.chk_all.checked){
      checkAllNothing("FORM_ORDER", "chk", false);
    }
  }
  	function isSafetyStockPoNo(pono){
		if(pono != '' 
			&& pono.length > 2
			&& pono.indexOf('S_') == 0 ){
			alert('input another P/O No(the P/O No start with \'S_\' is reserved by SafetyStock PO)');
			return true; 
		}else{
			return false;
		}			
	}
</script>
<script language="javascript"> 
 
  function shiplist(create_time, shipto_name, street, city, state, postl_code, contact_phone_number) {
    this.create_time = create_time;
    this.shipto_name = shipto_name;
    this.street      = street;
    this.city        = city;
    this.state       = state;
    this.postl_code  = postl_code;
    this.contact_phone_number = contact_phone_number;
  }
 
  function fillShipAddr() {
    var f = document.FORM_ORDER;
    var create_time = f.shiphistory.value;
 
    var found = 0;
    for (var i = 0; i < arr_shiphistory.length; i++){
      if (arr_shiphistory[i].create_time == create_time){
        found = 1;
        f.shipto_name.value = arr_shiphistory[i].shipto_name;
        f.street.value      = arr_shiphistory[i].street;
        f.city.value        = arr_shiphistory[i].city;
        f.state.value       = arr_shiphistory[i].state;
        f.postl_code.value  = arr_shiphistory[i].postl_code;
        f.contact_phone_number.value = arr_shiphistory[i].contact_phone_number;
        break;
      }
    }
 
    if (found == 0) {
      f.shipto_name.value = "";
      f.street.value      = "";
      f.city.value        = "";
      f.state.value       = "";
      f.postl_code.value  = "";
      f.contact_phone_number.value  = "";
    }
  }
 
  function changeEnable() {
    var f = document.FORM_ORDER;
    if(f.onetime_yn_chk[0].checked){
      f.shiphistory.disabled = false;
      f.shipto_name.disabled = false;
      f.street.disabled = false;
      f.city.disabled = false;
      f.state.disabled = false;
      f.postl_code.disabled = false;
      f.contact_phone_number.disabled = false;
    }
    else {
      f.shiphistory.disabled = true;
      f.shipto_name.disabled = true;
      f.street.disabled = true;
      f.city.disabled = true;
      f.state.disabled = true;
      f.postl_code.disabled = true;
      f.contact_phone_number.disabled = true;
    }
  }
 
  var arr_shiphistory = new Array(11);
 
  arr_shiphistory[0] = new shiplist("20091222133651", "PRECISION TELEVISION", "6455 CLARA ROAD", "HOUSTON", "TX", "77041", "925-825-5296");
 
 
  arr_shiphistory[1] = new shiplist("20100304202954", "PRECISION TELEVISION", "2820 BROADMOOR AVE", "CONCORD", "CA", "94520", "925-825-5296");
 
 
  arr_shiphistory[2] = new shiplist("20100322142400", "PRECISION TELEVISION", "2850 S. ROOSEVELT STREET SUITE 103", "TEMPE", "AZ", "85282", "925-825-5296");
 
 
  arr_shiphistory[3] = new shiplist("20100323142102", "PRECISION TELEVISION", "5400 WEST WT HARRIS BLVD STE H", "CHARLOTTE", "NC", "28269", "925-825-5296");
 
 
  arr_shiphistory[4] = new shiplist("20100324152440", "PRECISION TELEVISION", "806 BUCHANAN BLVD. STE 115 PMB#340", "BOULDER CITY", "NV", "89005", "925-825-5296");
 
 
  arr_shiphistory[5] = new shiplist("20101117161329644", "PRECISION TELEVISION", "2426 MYRTLE AVE", "EUREKA", "CA", "95501", "925-825-5296");
 
 
  arr_shiphistory[6] = new shiplist("20100401172105", "PRECISION TELEVISION", "2640 NORTHAVEN RD. SUITE 108", "DALLAS", "TX", "75229", "925-825-5296");
 
 
  arr_shiphistory[7] = new shiplist("20100614121610682", "PRECISION TELEVISION", "1000 KRAMER LANE STE 200", "AUSTIN", "TX", "78758", "925-825-5296");
 
 
  arr_shiphistory[8] = new shiplist("20100616144817782", "PRECISION TELEVISION", "301 W 28TH STREET STE H", "NATIONAL CITY", "CA", "91950", "925-825-5296");
 
 
  arr_shiphistory[9] = new shiplist("20100910135705521", "PRECISION TELEVISION", "16671 KNOTT AVE", "LA MIRADA", "CA", "90638", "925-825-5296");
 
 
  arr_shiphistory[10] = new shiplist("20100325142443", "PRECISION TELEVISION", "1100 SCOTT ROAD", "BURBANK", "CA", "91504", "925-825-5296");
 
 
 
  var listdata = new Array(5);
  var tid = "DTable";
 
  function onloadFunction(){
 
 
    setTimeout( "displayData()", 200 );
 
 
 
    openNotice();
 
 }
 
	// edit by miniERP 20071122
	function displayData(){
		var str = "   <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"LT_deco\" id="+tid+">";
		str = str + "    <tr>";
		str = str + "     <td width=\"5%\" class=\"LT_head\"><input type=checkbox name=chk_all onClick=checkAll();></td>";
		str = str + "     <td width=\"12%\" class=\"LT_head\">Parts No <font color=#FF6600>*</font></td>";
		str = str + "     <td width=\"7%\" class=\"LT_head\">Qty <font color=#FF6600>*</font></td>";
 
			str = str + "     <td width=\"12%\" class=\"LT_head\">Shipping Method <font color=#FF6600>*</font></td>";
 
		str = str + "     <td width=\"12%\" class=\"LT_head\">Narda/Ticket No</td>";
 
		str = str + "     <td width=\"11%\" class=\"LT_head\">Service Date</td>";
        str = str + "     <td width=\"12%\" class=\"LT_head\">Reason</td>";
 
		str = str + "     <td class=\"LT_headR\">Result</td>";
		str = str + "    </tr>";
 
			str = str + "<tr>";
			str = str + "  <td align=center class=\"LT_data\"><input type=\"checkbox\" name=\"chk\" value=\"checkbox\"></td>";
 
				str = str + "  <td class=\"LT_data\"><input name=\"material\" type=\"text\" class=\"Fdefaultp\" size=20 maxlength=18 onKeyUp=\"checkPartNo(this, 0)\" onChange=\"onChangePart(this)\"><a href=\"javascript:beforeOpen(0);\" onbeforeactivate=\"JAVASCRIPT:ignoreChange(true);\"><img src='/gspn/images/en/Icon_search.gif' border=\"0\" hspace=\"2\" align=\"absmiddle\"></a></td>";
				str = str + "  <td class=\"LT_data\"><input name=\"quantity\" type=\"text\" class=\"F100p\" maxlength=6  style=\"text-align:right;\" onChange=\"checknum(this);\"></td>";
 
				/*
                str = str + "<td class=\"LT_data\"><input name=\"ship_method0\" type=\"radio\" class=\"FDefault\" value=\"S\" checked>Standard";
				str = str + "<input name=\"ship_method0\" type=\"radio\" class=\"FDefault\" value=\"E\">Expedited";
	            str = str + "<input name=\"ship_method0\" type=\"radio\" class=\"FDefault\" value=\"N\">No Cool<input type=hidden name=ship_method></td>";
                */
                str = str + "<td class=\"LT_data\"><select name=\"ship_method\" class=\"F70p\" style=\"width:100%\">";
                str = str + "<option value=\"\"></option>";
 
                str = str + "<option value=\"D8\">Next Day</option>";
 
                str = str + "<option value=\"T1\">2ND Day</option>";
 
                str = str + "<option value=\"D1\">Ground</option>";
 
                str = str + "</select></td>";
 
				str = str + "  <td class=\"LT_data\"><input name=\"refno\" type=\"text\" class=\"F100\" maxlength=10></td>";
 
            str = str + "  <td class=\"LT_data\"><input name=\"service_date\" type=\"text\" class=\"Fdefault\" style=\"text-align:left;ime-mode:disabled\" size=8 maxlength=10 onkeydown=\"checkDateFormat(this, window.event.keyCode,'down','MM/dd/yyyy')\" onkeyup=\"checkDateFormat(this, window.event.keyCode,'up','MM/dd/yyyy')\"><img src=\"/gspn/images/en/Icon_cal.gif\" hspace=\"2\" border=\"0\" align=\"absmiddle\" onclick=\"javascript:beforeOpenCalendar('FORM_ORDER.service_date', 0);\" style=\"cursor:hand;\"></td>";
            str = str + "  <td class=\"LT_data\"><input name=\"reason\" type=\"text\" class=\"F100\" maxlength=50></td>";
 
            str = str + "  <td class=\"LT_dataR\"><input name=\"result\" type=\"text\" class=\"F90\" readonly style=\"border:none;\"></td>";
			str = str + "</tr>";
 
			str = str + "<tr>";
			str = str + "  <td align=center class=\"LT_data\"><input type=\"checkbox\" name=\"chk\" value=\"checkbox\"></td>";
 
				str = str + "  <td class=\"LT_data\"><input name=\"material\" type=\"text\" class=\"Fdefaultp\" size=20 maxlength=18 onKeyUp=\"checkPartNo(this, 1)\" onChange=\"onChangePart(this)\"><a href=\"javascript:beforeOpen(1);\" onbeforeactivate=\"JAVASCRIPT:ignoreChange(true);\"><img src='/gspn/images/en/Icon_search.gif' border=\"0\" hspace=\"2\" align=\"absmiddle\"></a></td>";
				str = str + "  <td class=\"LT_data\"><input name=\"quantity\" type=\"text\" class=\"F100p\" maxlength=6  style=\"text-align:right;\" onChange=\"checknum(this);\"></td>";
 
				/*
                str = str + "<td class=\"LT_data\"><input name=\"ship_method1\" type=\"radio\" class=\"FDefault\" value=\"S\" checked>Standard";
				str = str + "<input name=\"ship_method1\" type=\"radio\" class=\"FDefault\" value=\"E\">Expedited";
	            str = str + "<input name=\"ship_method1\" type=\"radio\" class=\"FDefault\" value=\"N\">No Cool<input type=hidden name=ship_method></td>";
                */
                str = str + "<td class=\"LT_data\"><select name=\"ship_method\" class=\"F70p\" style=\"width:100%\">";
                str = str + "<option value=\"\"></option>";
 
                str = str + "<option value=\"D8\">Next Day</option>";
 
                str = str + "<option value=\"T1\">2ND Day</option>";
 
                str = str + "<option value=\"D1\">Ground</option>";
 
                str = str + "</select></td>";
 
				str = str + "  <td class=\"LT_data\"><input name=\"refno\" type=\"text\" class=\"F100\" maxlength=10></td>";
 
            str = str + "  <td class=\"LT_data\"><input name=\"service_date\" type=\"text\" class=\"Fdefault\" style=\"text-align:left;ime-mode:disabled\" size=8 maxlength=10 onkeydown=\"checkDateFormat(this, window.event.keyCode,'down','MM/dd/yyyy')\" onkeyup=\"checkDateFormat(this, window.event.keyCode,'up','MM/dd/yyyy')\"><img src=\"/gspn/images/en/Icon_cal.gif\" hspace=\"2\" border=\"0\" align=\"absmiddle\" onclick=\"javascript:beforeOpenCalendar('FORM_ORDER.service_date', 1);\" style=\"cursor:hand;\"></td>";
            str = str + "  <td class=\"LT_data\"><input name=\"reason\" type=\"text\" class=\"F100\" maxlength=50></td>";
 
            str = str + "  <td class=\"LT_dataR\"><input name=\"result\" type=\"text\" class=\"F90\" readonly style=\"border:none;\"></td>";
			str = str + "</tr>";
 
			str = str + "<tr>";
			str = str + "  <td align=center class=\"LT_data\"><input type=\"checkbox\" name=\"chk\" value=\"checkbox\"></td>";
 
				str = str + "  <td class=\"LT_data\"><input name=\"material\" type=\"text\" class=\"Fdefaultp\" size=20 maxlength=18 onKeyUp=\"checkPartNo(this, 2)\" onChange=\"onChangePart(this)\"><a href=\"javascript:beforeOpen(2);\" onbeforeactivate=\"JAVASCRIPT:ignoreChange(true);\"><img src='/gspn/images/en/Icon_search.gif' border=\"0\" hspace=\"2\" align=\"absmiddle\"></a></td>";
				str = str + "  <td class=\"LT_data\"><input name=\"quantity\" type=\"text\" class=\"F100p\" maxlength=6  style=\"text-align:right;\" onChange=\"checknum(this);\"></td>";
 
				/*
                str = str + "<td class=\"LT_data\"><input name=\"ship_method2\" type=\"radio\" class=\"FDefault\" value=\"S\" checked>Standard";
				str = str + "<input name=\"ship_method2\" type=\"radio\" class=\"FDefault\" value=\"E\">Expedited";
	            str = str + "<input name=\"ship_method2\" type=\"radio\" class=\"FDefault\" value=\"N\">No Cool<input type=hidden name=ship_method></td>";
                */
                str = str + "<td class=\"LT_data\"><select name=\"ship_method\" class=\"F70p\" style=\"width:100%\">";
                str = str + "<option value=\"\"></option>";
 
                str = str + "<option value=\"D8\">Next Day</option>";
 
                str = str + "<option value=\"T1\">2ND Day</option>";
 
                str = str + "<option value=\"D1\">Ground</option>";
 
                str = str + "</select></td>";
 
				str = str + "  <td class=\"LT_data\"><input name=\"refno\" type=\"text\" class=\"F100\" maxlength=10></td>";
 
            str = str + "  <td class=\"LT_data\"><input name=\"service_date\" type=\"text\" class=\"Fdefault\" style=\"text-align:left;ime-mode:disabled\" size=8 maxlength=10 onkeydown=\"checkDateFormat(this, window.event.keyCode,'down','MM/dd/yyyy')\" onkeyup=\"checkDateFormat(this, window.event.keyCode,'up','MM/dd/yyyy')\"><img src=\"/gspn/images/en/Icon_cal.gif\" hspace=\"2\" border=\"0\" align=\"absmiddle\" onclick=\"javascript:beforeOpenCalendar('FORM_ORDER.service_date', 2);\" style=\"cursor:hand;\"></td>";
            str = str + "  <td class=\"LT_data\"><input name=\"reason\" type=\"text\" class=\"F100\" maxlength=50></td>";
 
            str = str + "  <td class=\"LT_dataR\"><input name=\"result\" type=\"text\" class=\"F90\" readonly style=\"border:none;\"></td>";
			str = str + "</tr>";
 
			str = str + "<tr>";
			str = str + "  <td align=center class=\"LT_data\"><input type=\"checkbox\" name=\"chk\" value=\"checkbox\"></td>";
 
				str = str + "  <td class=\"LT_data\"><input name=\"material\" type=\"text\" class=\"Fdefaultp\" size=20 maxlength=18 onKeyUp=\"checkPartNo(this, 3)\" onChange=\"onChangePart(this)\"><a href=\"javascript:beforeOpen(3);\" onbeforeactivate=\"JAVASCRIPT:ignoreChange(true);\"><img src='/gspn/images/en/Icon_search.gif' border=\"0\" hspace=\"2\" align=\"absmiddle\"></a></td>";
				str = str + "  <td class=\"LT_data\"><input name=\"quantity\" type=\"text\" class=\"F100p\" maxlength=6  style=\"text-align:right;\" onChange=\"checknum(this);\"></td>";
 
				/*
                str = str + "<td class=\"LT_data\"><input name=\"ship_method3\" type=\"radio\" class=\"FDefault\" value=\"S\" checked>Standard";
				str = str + "<input name=\"ship_method3\" type=\"radio\" class=\"FDefault\" value=\"E\">Expedited";
	            str = str + "<input name=\"ship_method3\" type=\"radio\" class=\"FDefault\" value=\"N\">No Cool<input type=hidden name=ship_method></td>";
                */
                str = str + "<td class=\"LT_data\"><select name=\"ship_method\" class=\"F70p\" style=\"width:100%\">";
                str = str + "<option value=\"\"></option>";
 
                str = str + "<option value=\"D8\">Next Day</option>";
 
                str = str + "<option value=\"T1\">2ND Day</option>";
 
                str = str + "<option value=\"D1\">Ground</option>";
 
                str = str + "</select></td>";
 
				str = str + "  <td class=\"LT_data\"><input name=\"refno\" type=\"text\" class=\"F100\" maxlength=10></td>";
 
            str = str + "  <td class=\"LT_data\"><input name=\"service_date\" type=\"text\" class=\"Fdefault\" style=\"text-align:left;ime-mode:disabled\" size=8 maxlength=10 onkeydown=\"checkDateFormat(this, window.event.keyCode,'down','MM/dd/yyyy')\" onkeyup=\"checkDateFormat(this, window.event.keyCode,'up','MM/dd/yyyy')\"><img src=\"/gspn/images/en/Icon_cal.gif\" hspace=\"2\" border=\"0\" align=\"absmiddle\" onclick=\"javascript:beforeOpenCalendar('FORM_ORDER.service_date', 3);\" style=\"cursor:hand;\"></td>";
            str = str + "  <td class=\"LT_data\"><input name=\"reason\" type=\"text\" class=\"F100\" maxlength=50></td>";
 
            str = str + "  <td class=\"LT_dataR\"><input name=\"result\" type=\"text\" class=\"F90\" readonly style=\"border:none;\"></td>";
			str = str + "</tr>";
 
			str = str + "<tr>";
			str = str + "  <td align=center class=\"LT_data\"><input type=\"checkbox\" name=\"chk\" value=\"checkbox\"></td>";
 
				str = str + "  <td class=\"LT_data\"><input name=\"material\" type=\"text\" class=\"Fdefaultp\" size=20 maxlength=18 onKeyUp=\"checkPartNo(this, 4)\" onChange=\"onChangePart(this)\"><a href=\"javascript:beforeOpen(4);\" onbeforeactivate=\"JAVASCRIPT:ignoreChange(true);\"><img src='/gspn/images/en/Icon_search.gif' border=\"0\" hspace=\"2\" align=\"absmiddle\"></a></td>";
				str = str + "  <td class=\"LT_data\"><input name=\"quantity\" type=\"text\" class=\"F100p\" maxlength=6  style=\"text-align:right;\" onChange=\"checknum(this);\"></td>";
 
				/*
                str = str + "<td class=\"LT_data\"><input name=\"ship_method4\" type=\"radio\" class=\"FDefault\" value=\"S\" checked>Standard";
				str = str + "<input name=\"ship_method4\" type=\"radio\" class=\"FDefault\" value=\"E\">Expedited";
	            str = str + "<input name=\"ship_method4\" type=\"radio\" class=\"FDefault\" value=\"N\">No Cool<input type=hidden name=ship_method></td>";
                */
                str = str + "<td class=\"LT_data\"><select name=\"ship_method\" class=\"F70p\" style=\"width:100%\">";
                str = str + "<option value=\"\"></option>";
 
                str = str + "<option value=\"D8\">Next Day</option>";
 
                str = str + "<option value=\"T1\">2ND Day</option>";
 
                str = str + "<option value=\"D1\">Ground</option>";
 
                str = str + "</select></td>";
 
				str = str + "  <td class=\"LT_data\"><input name=\"refno\" type=\"text\" class=\"F100\" maxlength=10></td>";
 
            str = str + "  <td class=\"LT_data\"><input name=\"service_date\" type=\"text\" class=\"Fdefault\" style=\"text-align:left;ime-mode:disabled\" size=8 maxlength=10 onkeydown=\"checkDateFormat(this, window.event.keyCode,'down','MM/dd/yyyy')\" onkeyup=\"checkDateFormat(this, window.event.keyCode,'up','MM/dd/yyyy')\"><img src=\"/gspn/images/en/Icon_cal.gif\" hspace=\"2\" border=\"0\" align=\"absmiddle\" onclick=\"javascript:beforeOpenCalendar('FORM_ORDER.service_date', 4);\" style=\"cursor:hand;\"></td>";
            str = str + "  <td class=\"LT_data\"><input name=\"reason\" type=\"text\" class=\"F100\" maxlength=50></td>";
 
            str = str + "  <td class=\"LT_dataR\"><input name=\"result\" type=\"text\" class=\"F90\" readonly style=\"border:none;\"></td>";
			str = str + "</tr>";
 
		str = str + "</table>";
 
		document.all.sortDIV.innerHTML = str;
	}
  
  function displayListData(){
    var str = "   <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"LT_deco\" id="+tid+">";
      str = str + "    <tr>";
      str = str + "     <td width=\"5%\" class=\"LT_head\"><input type=checkbox name=chk_all onClick=checkAll();></td>";
      str = str + "     <td width=\"12%\" class=\"LT_head\">Parts No <font color=#FF6600>*</font></td>";
      str = str + "     <td width=\"7%\" class=\"LT_head\">Qty <font color=#FF6600>*</font></td>";
 
      str = str + "     <td width=\"12%\" class=\"LT_head\">Shipping Method <font color=#FF6600>*</font></td>";
 
      str = str + "     <td width=\"12%\" class=\"LT_head\">Narda/Ticket No</td>";
 
      str = str + "     <td width=\"11%\" class=\"LT_head\">Service Date</td>";
      str = str + "     <td width=\"12%\" class=\"LT_head\">Reason</td>";
 
      str = str + "     <td class=\"LT_headR\">Result</td>";
      str = str + "    </tr>";
 
      str = str + "</table>";
 
    document.all.sortDIV.innerHTML = str;
  }
  
  function addRow(){
    var numrows = document.all.DTable.rows.length;
    if(numrows < 201){
      var newRow = document.all.DTable.insertRow(numrows);
      var cellnums = document.all.DTable.rows[numrows-1].cells.length;
      var c0   = newRow.insertCell(0);
      var c1   = newRow.insertCell(1);
      var c2   = newRow.insertCell(2);
      var c3   = newRow.insertCell(3);
      var c4   = newRow.insertCell(4);
 
      c0.className = "LT_data";
      c0.align = "center";
      c0.innerHTML = "<input type=\"checkbox\" name=\"chk\" value=\"checkbox\">";
  
      c1.className = "LT_data";
      c1.innerHTML =
         "<input name=\"material\" type=\"text\" class=\"Fdefaultp\" size=20 maxlength=18 onKeyUp=\"checkPartNo(this, "+(numrows-1)+")\" onChange=\"onChangePart(this)\"><a href=\"javascript:beforeOpen("+(numrows-1)+");\" onbeforeactivate=\"JAVASCRIPT:ignoreChange(true);\"><img src=\"/gspn/images/en/Icon_search.gif\" hspace=\"2\" border=\"0\" align=\"absmiddle\"></a>";
  
      c2.className = "LT_data";
      c2.innerHTML =
         "<input name=\"quantity\" type=\"text\" class=\"F100p\" maxlength=6  style=\"text-align:right;\" onChange=\"checknum(this);\"></td>";
  
      c3.className = "LT_data";
      c3.innerHTML =
         "<input name=\"refno\" type=\"text\" maxlength=10 class=\"F100\">";
  
      c4.className = "LT_dataR";
      c4.innerHTML =
         "<input name=\"result\" type=\"text\" class=\"F90\" readonly style=\"border:none;\">";
 
 
      var c5   = newRow.insertCell(3);
      var c5HTML = "";
      var ship_method_all = document.FORM_ORDER.ship_method_all.value;
 
      c5.className = "LT_data";
      c5HTML =
      //  "<input name=\"ship_method"+(numrows-1)+"\" type=\"radio\" class=\"FDefault\" value=\"S\" checked>Standard"+
      //  "<input name=\"ship_method"+(numrows-1)+"\" type=\"radio\" class=\"FDefault\" value=\"E\">Expedited"+
      //  "<input name=\"ship_method"+(numrows-1)+"\" type=\"radio\" class=\"FDefault\" value=\"N\">No Cool"+
      //  "<input type=hidden name=ship_method>";
          "<select name=\"ship_method\" class=\"F70p\" style=\"width:100%\">" +
          "<option value=\"\"></option>";
 
      if("D8" == ship_method_all) {
        c5HTML +=
          "<option value=\"D8\" selected>Next Day</option>";
      }
      else {
        c5HTML +=
          "<option value=\"D8\">Next Day</option>";
      }
 
      if("T1" == ship_method_all) {
        c5HTML +=
          "<option value=\"T1\" selected>2ND Day</option>";
      }
      else {
        c5HTML +=
          "<option value=\"T1\">2ND Day</option>";
      }
 
      if("D1" == ship_method_all) {
        c5HTML +=
          "<option value=\"D1\" selected>Ground</option>";
      }
      else {
        c5HTML +=
          "<option value=\"D1\">Ground</option>";
      }
 
      c5HTML +=
          "</select>";
      c5.innerHTML = c5HTML;
    var c6   = newRow.insertCell(5);
    c6.className = "LT_data";
    c6.innerHTML =
         "<input name=\"service_date\" type=\"text\" class=\"Fdefault\" style=\"text-align:left;ime-mode:disabled\" size=8 maxlength=10 onkeydown=\"checkDateFormat(this, window.event.keyCode,'down','MM/dd/yyyy')\" onkeyup=\"checkDateFormat(this, window.event.keyCode,'up','MM/dd/yyyy')\"><img src=\"/gspn/images/en/Icon_cal.gif\" hspace=\"2\" border=\"0\" align=\"absmiddle\" onclick=\"javascript:beforeOpenCalendar('FORM_ORDER.service_date', "+(numrows-1)+");\" style=\"cursor:hand;\">";
 
    var c7   = newRow.insertCell(6);
    c7.className = "LT_data";
    c7.innerHTML =
         "<input name=\"reason\" type=\"text\" maxlength=50 class=\"F100\">";
 
 
    }else{
      //alert("1~200 check !");
         alert("Today only, please do not add more than 10 items in a single P/O.\nIf you need more than 10 items, please create another P/O.");
    }
 
  }
 
  function delRow(){
    var j=0;
    var k=0;
    var f = document.FORM_ORDER;
    numrows = document.all.DTable.rows.length-1;
 
 
    if(numrows == 1){
      if(f.chk.checked == false){
        alert("Check one or more!");
        return;
      }
      else{
        if(confirm("Do you really want to delete?")){
          DTable.deleteRow(numrows);
		  try {
		    document.frames['Cmp_1'].reloadDisplay();
		  }
		  catch(e) {
		  }
          return;
        }
        else
          return;
      }
    }
    else {
      for(i=0; i< numrows; i++) {
        if(f.chk[i].checked == true)
          j++;
      }
      if(j==0){
        alert("Check one or more!");
        return;
      }
      else if(j>0){
        if(confirm("Do you really want to delete?")){
          var c = numrows-j;
          
          if(c==0){
            for(var k=numrows; k>0; k--){
              DTable.deleteRow(k);
            }
          }else{
            if((numrows)==2){
              if(f.chk[0].checked == true && f.chk[1].checked == true){
                DTable.deleteRow(1);
                DTable.deleteRow(2);
              }else if(f.chk[0].checked == true && f.chk[1].checked == false){
                arrMat = new Array(1);
                //shipMethod = new Array(1);
                arrServiceDate = new Array(1);
                DTable.deleteRow(1);
                if(f.material.length == null){
                  arrMat[0] = f.material.value;
                  arrServiceDate[0] = f.service_date.value;
                  //if(f.ship_method0[1].checked)
                  //  shipMethod[0] = "E";
                }else{
                  arrMat[0] = f.material[k].value;
                  arrServiceDate[0] = f.service_date[k].value;
                  //if(eval("f.ship_method"+k)[1].checked)
                  //  shipMethod[0] = "E";
                }
              }else if(f.chk[0].checked == false && f.chk[1].checked == true){
                arrMat = new Array(1);
                //shipMethod = new Array(1);
                arrServiceDate = new Array(1);
                DTable.deleteRow(2);
                if(f.material.length == null){
                  arrMat[0] = f.material.value;
                  arrServiceDate[0] = f.service_date.value;
                  //if(f.ship_method0[1].checked)
                  //  shipMethod[0] = "E";
                }else{
                  arrMat[0] = f.material[k].value;
                  arrServiceDate[0] = f.service_date[k].value;
                  //if(eval("f.ship_method"+k)[1].checked)
                  //  shipMethod[0] = "E";
                }
              }
            }else if((numrows)>2){
              arrMat = new Array(c);
              //shipMethod = new Array(c);
              arrServiceDate = new Array(c);
              for(var k=numrows-1; k>-1; k--){
                if(f.chk[k].checked == true){
                  DTable.deleteRow(k+1);
                }else{
                  if(f.material.length == null){
                    arrMat[c-1] = f.material.value;
                    arrServiceDate[c-1] = (f.service_date)?f.service_date.value:'';
                    //if(f.ship_method0[1].checked)
                    //  shipMethod[c-1] = "E";
                  }else{
                    arrMat[c-1] = f.material[k].value;
                    arrServiceDate[c-1] = (f.service_date)?f.service_date[k].value:'';
                    //if(eval("f.ship_method"+k)[1].checked)
                    //  shipMethod[c-1] = "E";
                  }
                  c--;
                }
              }
            }
          }
		  try {
		    document.frames['Cmp_1'].reloadDisplay();
		  }
		  catch(e) {
		  }
        }else{
          return;
        }
      }
      else{
        return;
      }
      afterDelete();
    }
 
  }
 
  function afterDelete(){
    var i = 0;
    var numrows = document.all.DTable.rows.length;
    var f = document.FORM_ORDER;
 
    for (i=0; i<numrows-1; i++) {
      document.all.DTable.rows.item(i+1).cells(1).innerHTML =
        "<input name=\"material\" type=\"text\" class=\"Fdefaultp\" size=20 maxlength=18 value=\""+arrMat[i]+"\" onKeyUp=\"checkPartNo(this, "+i+")\" onChange=\"onChangePart(this)\"><a href=\"javascript:beforeOpen("+i+");\" onbeforeactivate=\"JAVASCRIPT:ignoreChange(true);\"><img src=\"/gspn/images/en/Icon_search.gif\" hspace=\"2\" border=\"0\" align=\"absmiddle\"></a>";
 
      /*
      var checkE = "";
      var checkS = "";
      if(shipMethod[i] == "E") checkE = "checked";
      else checkS = "checked";
      document.all.DTable.rows.item(i+1).cells(3).innerHTML =
        "<input name=\"ship_method"+i+"\" type=\"radio\" class=\"FDefault\" value=\"S\" "+ checkS +">Standard"+
        "<input name=\"ship_method"+i+"\" type=\"radio\" class=\"FDefault\" value=\"E\" "+ checkE +">Expedited"+
		"<input name=\"ship_method"+i+"\" type=\"radio\" class=\"FDefault\" value=\"N\" "+ checkE +">No Cool"+
        "<input type=hidden name=ship_method value=\""+shipMethod[i]+"\">";
      */
      document.all.DTable.rows.item(i+1).cells(5).innerHTML =
        "<input name=\"service_date\" value=\""+arrServiceDate[i]+"\" type=\"text\" class=\"Fdefault\" style=\"text-align:left;ime-mode:disabled\" size=8 maxlength=10 onkeydown=\"checkDateFormat(this, window.event.keyCode,'down','MM/dd/yyyy')\" onkeyup=\"checkDateFormat(this, window.event.keyCode,'up','MM/dd/yyyy')\"><img src=\"/gspn/images/en/Icon_cal.gif\" hspace=\"2\" border=\"0\" align=\"absmiddle\" onclick=\"javascript:beforeOpenCalendar('FORM_ORDER.service_date', "+i+");\" style=\"cursor:hand;\"></td>";
      
 
    }
    f.chk_all.checked = false;
  }
 
</script>
<script language="javascript"> 
  function reload(strUrl,RecId){
    if (document.all["cubBody"].style.display != "none") {
      document.frames[RecId].location=strUrl;
    }
  }
 
  function fnResize(){
    if(document.all["cubBody"].style.display == "none"){
      document.all["cubBody"].style.display = "";
      document.all["resize"].src = "/gspn/images/en/img_minimum.gif";
      document.all["resize"].alt = "MINIMIZE";
      document.all["refresh"].style.cursor = "hand";
    }else{
      document.all["cubBody"].style.display = "none";
      document.all["resize"].src = "/gspn/images/en/img_maximum.gif";
      document.all["resize"].alt = "MAXIMIZE";
      document.all["refresh"].style.cursor = "default";
    }
  }
 
  function changeAccount() {
    document.FORM_ORDER.action = "ORDOrder.jsp";
    document.FORM_ORDER.submit();
  }
 
  function manageAddress(){
    var f = document.FORM_ORDER;
 
    url = "/GSPN/gspn/ord/popup/ORDAddressManage.jsp?account=0006087721";
    w=window.open(url,"part_popup",'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,top=150,left=200,width=800,height=530');
    w.focus();
  }
 
  function delAllRow(){
 
 
	var k=0;
  	var f = document.FORM_ORDER;
 
	numrows = document.all.DTable.rows.length-1;
 
	for(var k=numrows-1; k>-1; k--){
 
		DTable.deleteRow(k+1);
 
	}
	afterDelete();
  }
  
  function importFile() {
 
	var f = document.FORM_FILE;
  	f.target = "fileimport";
	f.search.value = "FORM";
 
	w=window.open("","fileimport",'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,top=150,left=200,width=700,height=300');
	f.submit();
	w.focus();
 
  }
 
  function checkComponentPart(){
	var f = document.FORM_ORDER;
	var numrows = 0;
	if (typeof(document.all.DTable.rows.length)  == 'undefined')
	  numrows = 1
	else
	  numrows = document.all.DTable.rows.length-1;
 
 
    var rc = 0;
 
 
	if(numrows == 0){
	  //no rows
 
	  alert("Please input one or more detail items.");
 
	  return;
	}
	else if(numrows == 1){
	  //input
	  rc = 1;
	}
	else{
	  //input arr
	  for(i=0; i<numrows; i++){
	    if(f.material[i].value.length == 0 && f.quantity[i].value.length == 0){
 
		  if(rc == 0){
			alert("Please input one or more detail items.");
 
			return;
		  }
		}else{
		  if(f.material[i].value.length != 0 || f.quantity[i].value.length != 0){
 
 
			if(f.material[i].value.length == 0){
			  alert("Please search parts.");
 
			  f.material[i].focus();
			  return;
			}
		  }
		  rc++;
		}
	  }
	}
	
	f.search.value = "SINGLE_PART_CHECK";
	f.action = "/GSPN/gspn/ord/partorder/ORDCheckComponentPart.jsp";
 
	f.target = "chk_part_popup";
	w=window.open("","chk_part_popup",'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,top=150,left=200,width=1000,height=600');
 
	f.submit();
	w.focus();
  }
  
  function onChangePart(obj) {
 
	var f = document.FORM_ORDER;
  	//var material = f.material[idx].value;
	//var qty      = f.quantity[idx].value.length;
	var material = obj.value;
	var qty      = 0;
	if (material.length == 0)
	  return;
	var url = "ORDCheckComponentPart.jsp?single_mode=Y&s_material=" + material + "&s_quantity=" + qty;
	f.search.value = "SINGLE_PART_CHECK";
 
	f.action = url;
 
	f.target = "chk_part_popup";
	w=window.open(url,"chk_part_popup",'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,top=100,left=100,width=1000,height=600');
 
	f.submit();
 
	w.focus();
  }
 
  function changeShipMethodAll(val) {
    var f = document.FORM_ORDER;
	var numrows = 0;
	if (typeof(document.all.DTable.rows.length)  == 'undefined')
	  numrows = 1
	else
	  numrows = document.all.DTable.rows.length-1;
 
	if(numrows == 0){
	  //no rows
	  return;
	}
	else if(numrows == 1){
	  f.ship_method.value = val;
	}
	else {
	  //input arr
	  for(i=0; i<numrows; i++) {
	    f.ship_method[i].value = val;
	  }
	}
  }
      
  function changeTicketNo(val) {
    var f = document.FORM_ORDER;
  }
 
  function popInit() {
 
  }
 
 
</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"
onload="javascript:popInit();onloadFunction();">
<a href="top"></a>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <!-- Left Menu Block S -->
    
 
 
 
 
 
 
 
 
 
    <!-- Left Menu Block E -->
    <td valign="top" class="Rbg">
    	
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
   <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
     <td class="Ttxt_loca"> <a href="/GSPN/gspn/GSPNMain.jsp"><font class="loca">B2B Main</font></a>
 > 
<font class='loca'>Parts Management</font>
 > 
<font class='loca'>Parts Order</font>
 > 
Create New P/O
 
	  </td>
    </tr>
   </table>
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
     <td class="3_deco">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
 
        <td class="3_menu"><a href="#" onclick="javascript:checkAccessBlock('', '', '/GSPN/gspn/common/GSPN_GOTO.jsp?pgmId=ORDOrder&url=/GSPN/gspn/ord/partorder/ORDOrder.jsp');"  >Create New P/O</a></td>
 
        <td class="3_menu"><a href="#" onclick="javascript:checkAccessBlock('', '', '/GSPN/gspn/common/GSPN_GOTO.jsp?pgmId=ORDOrderStatus&url=/GSPN/gspn/ord/partorder/ORDOrderStatus.jsp');"  >P/O Status</a></td>
 
        <td class="3_menu"><a href="#" onclick="javascript:checkAccessBlock('', '', '/GSPN/gspn/common/GSPN_GOTO.jsp?pgmId=ORDPending&url=/GSPN/gspn/ord/partorder/ORDPending.jsp');"  >Backorder Status</a></td>
 
        <td class="3_menu"><a href="#" onclick="javascript:checkAccessBlock('', '', '/GSPN/gspn/common/GSPN_GOTO.jsp?pgmId=ORDShipping&url=/GSPN/gspn/ord/partorder/ORDShipping.jsp');"  >Shipping Information</a></td>
<td>&nbsp;</td></tr><tr>
 
        <td class="3_menu"><a href="#" onclick="javascript:checkAccessBlock('', '', '/GSPN/gspn/common/GSPN_GOTO.jsp?pgmId=ORDPartsAndWBSummary&url=/GSPN/gspn/ord/summary/ORDPartBillSummary.jsp');"  >Parts & W/Bill Summary</a></td>
 
        <td class="3_menu"><a href="#" onclick="javascript:checkAccessBlock('', '', '/GSPN/gspn/common/GSPN_GOTO.jsp?pgmId=ORDARStatement&url=/GSPN/gspn/ord/ar/GFQ_ORDArStatement.jsp');"  >Monthly Statement</a></td>
 
        <td class="3_menu"><a href="#" onclick="javascript:checkAccessBlock('', '', '/GSPN/gspn/common/GSPN_GOTO.jsp?pgmId=INVOICEINFO&url=/GSPN/gspn/ord/accinfo/ORDInvoiceInfo.jsp');"  >Invoice Print</a></td>
 
        <td class="3_menu"><a href="#" onclick="javascript:checkAccessBlock('', '', '/GSPN/gspn/common/GSPN_GOTO.jsp?pgmId=CREDITMEMO&url=/GSPN/gspn/ord/accinfo/ORDCreditMemoInfo.jsp');"  >Credit Memo Print</a></td>
<td>&nbsp;</td></tr><tr>
 
        <td class="3_menu" colspan="4" align="left"><a href="#" onclick="javascript:checkAccessBlock('', '', '/GSPN/gspn/common/GSPN_GOTO.jsp?pgmId=ORDInvoiceInfo&url=/GSPN/gspn/ord/partorder/ORDInvoiceInfo.jsp');"  >Invoice Detail Download</a></td>
 
       </tr>
      </table>
     </td>
    </tr>
   </table>
 
 
 
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <form name="FORM_ORDER" method="post" onKeyPress='JAVASCRIPT:formChanged();'>
        <input type="hidden" name="search">
        <input type="hidden" name="rowcount">
        <!-- added by miniERP 20071122 -->   
				<input type="hidden" name="mode" value="">
				<input type="hidden" name="type" value="">
 
        <tr>
          <td class="Tbg_left">
            <table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td class="Ttxt_main">Create New P/O</td>
              </tr>
            </table>
          </td>
          <td class="Tbg_mid">&nbsp;</td>
          <td class="Tbg_right">&nbsp; </td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" id="contTable">
        <tr>
          <td width="100%" valign="top">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td class="STdeco_Ltop"></td>
                <td colspan="2" class="STdeco_top"><img src="/gspn/images/en/spacer.gif"></td>
                <td class="STdeco_Rtop"></td>
              </tr>
              <tr>
                <td class="STdeco_left"><img src="/gspn/images/en/spacer.gif"></td>
                <td class="ST_con">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="25%" class="ST_head">P/O Date</td>
                      <td class="ST_data">05/11/2011<input type=hidden name="po_date" value="05/11/2011"></td>
                    </tr>
                    <tr>
                      <td class="ST_head">Account</td>
                      <td class="ST_data"><select name="account" id="account" class="F70" style="width:146px;" onChange="changeAccount()"> 
	  <option value="0006087721"  selected> 0006087721</option>
 
     </select></td>
                    <!--<td class="ST_data">0006087721 (PRECISION TELEVISION)<input type=hidden name="account" value="0006087721"></td>-->
                    </tr>
                    <tr>
                      <td class="ST_head">P/O No <font color="#FF6600">*</font></td>
                      <td class="ST_data">
                      <input name="customer_po_number" type="text" class="Fdefaultp" maxlength=20 value="" >
                      </td>
                    </tr>
 
 
  <script language="javascript">
    showDataprocessBar();
  </script>
 
 
 
                    <tr>
                      <td class="ST_head">Ticket No.</td>
                      <td class="ST_data">
                        <select name="ticket_no" class="F70" style="width:146px;" onChange="changeTicketNo(this.value)">
                        <option value=""></option>
 
                        <option value="4008216703" >4008216703</option>
 
                        <option value="4008218606" >4008218606</option>
 
                        <option value="4008221579" >4008221579</option>
 
                        <option value="4008231869" >4008231869</option>
 
                        <option value="4008232789" >4008232789</option>
 
                        <option value="4008234690" >4008234690</option>
 
                        <option value="4008234928" >4008234928</option>
 
                        <option value="4008236048" >4008236048</option>
 
                        <option value="4008236511" >4008236511</option>
 
                        <option value="4008237559" >4008237559</option>
 
                        <option value="4008237936" >4008237936</option>
 
                        <option value="4008239402" >4008239402</option>
 
                        <option value="4008239576" >4008239576</option>
 
                        <option value="4008239581" >4008239581</option>
 
                        <option value="4008239837" >4008239837</option>
 
                        </select>
                      </td>
                    </tr>
 
  <script language="javascript">
    hideDataprocessBar();
  </script>
 
 
                    
 
                    <tr>
                      <td class="ST_head">Shipping Method</td>
                      <td class="ST_data">
                        <select name="ship_method_all" class="F70" style="width:146px;" onChange="changeShipMethodAll(this.value)">
                        <option value=""></option>
 
                        <option value="D8" >Next Day</option>
 
                        <option value="T1" >2ND Day</option>
 
                        <option value="D1" >Ground</option>
 
                        </select>
                      </td>
                    </tr>
 
                    <tr>
                      <td class="ST_head">Ship To</td>
                      <td class="ST_data">
                        <select name="ship_to" class="Fdefault">
 
                        <OPTION VALUE="6087721" >
            6087721 / 2820 BROAD/CONCORD
                        </OPTION>
 
                        </SELECT>
                      </td>
                    </tr>
 
                  </table>
                </td>
                <td width="100" align="center" valign="bottom" class="ST_con">&nbsp;</td>
                <td class="STdeco_right"><img src="/gspn/images/en/spacer.gif"></td>
              </tr>
              <tr>
                <td class="STdeco_Rtop"></td>
                <td colspan="2" class="STdeco_btm"><img src="/gspn/images/en/spacer.gif"></td>
                <td class="STdeco_Ltop"></td>
              </tr>
            </table>
 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td class="LT_title">One Time Ship To Address</td>
              </tr>
            </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td class="STdeco_Ltop"></td>
                <td colspan="2" class="STdeco_top"><img src="/gspn/images/en/spacer.gif"></td>
                <td class="STdeco_Rtop"></td>
              </tr>
              <tr>
                <td class="STdeco_left"><img src="/gspn/images/en/spacer.gif"></td>
                <td class="ST_con">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="ST_head" colspan=2>Change ship to address for this order?</td>
 
                      <td class="ST_data" colspan=2>
                       <input type="radio" name="onetime_yn_chk" value="Y"  onClick="changeEnable();" >
                       Yes
                       <input type="radio" name="onetime_yn_chk" value="N" checked  onClick="changeEnable();">
                       No
                       <input type=hidden name=onetime_yn>
&nbsp;&nbsp;&nbsp;
<a href="javascript:manageAddress();" onbeforeactivate='JAVASCRIPT:ignoreChange(true);'><img src="/gspn/images/en/Bt_ontime.gif" hspace="2" border="0"></a>
                      </td>
                    </tr>
 
                    <tr>
                      <td class="ST_head">Address History</td>
                      <td colspan="3" class="ST_data">
                      <select name="shiphistory" class="F100" onChange="fillShipAddr();" disabled>
                        <option value="">-- select address --</option>
 
                        <option value="20091222133651" >
                [PRECISION TELEVISION]&nbsp;6455 CLARA ROAD HOUSTON, TX 77041 [925-825-5296]
                        </option>
 
                        <option value="20100304202954" >
                [PRECISION TELEVISION]&nbsp;2820 BROADMOOR AVE CONCORD, CA 94520 [925-825-5296]
                        </option>
 
                        <option value="20100322142400" >
                [PRECISION TELEVISION]&nbsp;2850 S. ROOSEVELT STREET SUITE 103 TEMPE, AZ 85282 [925-825-5296]
                        </option>
 
                        <option value="20100323142102" >
                [PRECISION TELEVISION]&nbsp;5400 WEST WT HARRIS BLVD STE H CHARLOTTE, NC 28269 [925-825-5296]
                        </option>
 
                        <option value="20100324152440" >
                [PRECISION TELEVISION]&nbsp;806 BUCHANAN BLVD. STE 115 PMB#340 BOULDER CITY, NV 89005 [925-825-5296]
                        </option>
 
                        <option value="20101117161329644" >
                [PRECISION TELEVISION]&nbsp;2426 MYRTLE AVE EUREKA, CA 95501 [925-825-5296]
                        </option>
 
                        <option value="20100401172105" >
                [PRECISION TELEVISION]&nbsp;2640 NORTHAVEN RD. SUITE 108 DALLAS, TX 75229 [925-825-5296]
                        </option>
 
                        <option value="20100614121610682" >
                [PRECISION TELEVISION]&nbsp;1000 KRAMER LANE STE 200 AUSTIN, TX 78758 [925-825-5296]
                        </option>
 
                        <option value="20100616144817782" >
                [PRECISION TELEVISION]&nbsp;301 W 28TH STREET STE H NATIONAL CITY, CA 91950 [925-825-5296]
                        </option>
 
                        <option value="20100910135705521" >
                [PRECISION TELEVISION]&nbsp;16671 KNOTT AVE LA MIRADA, CA 90638 [925-825-5296]
                        </option>
 
                        <option value="20100325142443" >
                [PRECISION TELEVISION]&nbsp;1100 SCOTT ROAD BURBANK, CA 91504 [925-825-5296]
                        </option>
 
                      </select>
                      </td>
                    </tr>
 
                    <tr>
                      <td width=25% class="ST_head">Name</td>
                      <td class="ST_data" colspan=3>
                      <input name="shipto_name" type="text" class="F70" maxlength=35 value="" disabled>
                      </td>
                    </tr>
                    <tr>
                      <td class="ST_head">Street</td>
                      <td class="ST_data" colspan=3>
                      <input name="street" type="text" class="F70" maxlength=35 value="" disabled>
                      </td>
                    </tr>
                    <tr>
                      <td class="ST_head">City</td>
                      <td class="ST_data" colspan=3>
                      <input name="city" type="text" class="F70" maxlength=35 value="" disabled>
                      </td>
                    </tr>
                    <tr>
                      <td class="ST_head">
 
        State
 
                      </td>
                      <td class="ST_data" width=20%>
                      <select name="state" class="Fdefault" disabled>
                        <OPTION VALUE=""></OPTION>
 
                        <OPTION VALUE="AK" >AK</OPTION>
 
                        <OPTION VALUE="AL" >AL</OPTION>
 
                        <OPTION VALUE="AR" >AR</OPTION>
 
                        <OPTION VALUE="AZ" >AZ</OPTION>
 
                        <OPTION VALUE="CA" >CA</OPTION>
 
                        <OPTION VALUE="CO" >CO</OPTION>
 
                        <OPTION VALUE="CT" >CT</OPTION>
 
                        <OPTION VALUE="DC" >DC</OPTION>
 
                        <OPTION VALUE="DE" >DE</OPTION>
 
                        <OPTION VALUE="FL" >FL</OPTION>
 
                        <OPTION VALUE="GA" >GA</OPTION>
 
                        <OPTION VALUE="HI" >HI</OPTION>
 
                        <OPTION VALUE="IA" >IA</OPTION>
 
                        <OPTION VALUE="ID" >ID</OPTION>
 
                        <OPTION VALUE="IL" >IL</OPTION>
 
                        <OPTION VALUE="IN" >IN</OPTION>
 
                        <OPTION VALUE="KS" >KS</OPTION>
 
                        <OPTION VALUE="KY" >KY</OPTION>
 
                        <OPTION VALUE="LA" >LA</OPTION>
 
                        <OPTION VALUE="MA" >MA</OPTION>
 
                        <OPTION VALUE="MD" >MD</OPTION>
 
                        <OPTION VALUE="ME" >ME</OPTION>
 
                        <OPTION VALUE="MI" >MI</OPTION>
 
                        <OPTION VALUE="MN" >MN</OPTION>
 
                        <OPTION VALUE="MO" >MO</OPTION>
 
                        <OPTION VALUE="MP" >MP</OPTION>
 
                        <OPTION VALUE="MS" >MS</OPTION>
 
                        <OPTION VALUE="MT" >MT</OPTION>
 
                        <OPTION VALUE="NC" >NC</OPTION>
 
                        <OPTION VALUE="ND" >ND</OPTION>
 
                        <OPTION VALUE="NE" >NE</OPTION>
 
                        <OPTION VALUE="NH" >NH</OPTION>
 
                        <OPTION VALUE="NJ" >NJ</OPTION>
 
                        <OPTION VALUE="NM" >NM</OPTION>
 
                        <OPTION VALUE="NV" >NV</OPTION>
 
                        <OPTION VALUE="NY" >NY</OPTION>
 
                        <OPTION VALUE="OH" >OH</OPTION>
 
                        <OPTION VALUE="OK" >OK</OPTION>
 
                        <OPTION VALUE="OR" >OR</OPTION>
 
                        <OPTION VALUE="PA" >PA</OPTION>
 
                        <OPTION VALUE="PR" >PR</OPTION>
 
                        <OPTION VALUE="RI" >RI</OPTION>
 
                        <OPTION VALUE="SC" >SC</OPTION>
 
                        <OPTION VALUE="SD" >SD</OPTION>
 
                        <OPTION VALUE="TN" >TN</OPTION>
 
                        <OPTION VALUE="TX" >TX</OPTION>
 
                        <OPTION VALUE="UT" >UT</OPTION>
 
                        <OPTION VALUE="VT" >VT</OPTION>
 
                        <OPTION VALUE="VA" >VA</OPTION>
 
                        <OPTION VALUE="VI" >VI</OPTION>
 
                        <OPTION VALUE="WA" >WA</OPTION>
 
                        <OPTION VALUE="WI" >WI</OPTION>
 
                        <OPTION VALUE="WV" >WV</OPTION>
 
                        <OPTION VALUE="WY" >WY</OPTION>
 
                      </SELECT>
                      </td>
                      <td class="ST_head" width=20%>Zip Code</td>
                      <td class="ST_data">
                        <input name="postl_code" type="text" size=10 maxlength=10 value="" disabled>
                      </td>
                    </tr>
                    <tr>
                      <td class="ST_head">Contact Phone Number</td>
                      <td class="ST_data" colspan=3>
                      <input name="contact_phone_number" type="text" class="F70" maxlength=35 value="" disabled>
                      </td>
                    </tr>
                  </table>
 
                </td>
                <td width="100" align="center" valign="bottom" class="ST_con">&nbsp;</td>
                <td class="STdeco_right"><img src="/gspn/images/en/spacer.gif"></td>
              </tr>
              <tr>
                <td class="STdeco_Rtop"></td>
                <td colspan="2" class="STdeco_btm"><img src="/gspn/images/en/spacer.gif"></td>
                <td class="STdeco_Ltop"></td>
              </tr>
            </table>
 
 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td class="LT_title">Notification E-mail Address</td>
              </tr>
            </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="IT_deco">
              <tr>
                <td width="40%" class="ST_shead">Please check here to receive notification by e-mail</td>
                <td class="ST_sdata">
                <input type="radio" name="e_flag_chk" value="Y" checked >
                Yes
                <input type="radio" name="e_flag_chk" value="N" >
                No
                <input type=hidden name=e_flag>
                </td>
              </tr>
              <tr>
                <td class="ST_shead">E-mail</td>
                <td class="ST_sdata">
                <input name="email" type="text" class="F70" value="partsorder@precisiontv.net">
                </td>
              </tr>
            </table>
 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="40%" class="LT_title">Cart Information</td>
                <td class="ST_data" align=right>&nbsp;</td>
              </tr>
            </table>
            <!-- table format list -->
            <div id='sortDIV'>
            </div>
 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
 
              <tr>
				<td class="BT">
				<a href="javascript:importFile();"><img src="/gspn/images/en/Bt_import.gif" hspace="2" border="0"></a>
 
				<a href="javascript:checkComponentPart();"><img src="/gspn/images/en/Bt_check_component.gif" hspace="2" border="0"></a>
				<a href="javascript:beforeVerify();" onbeforeactivate='JAVASCRIPT:ignoreChange(true);'><img src="/gspn/images/en/Bt_verify.gif" hspace="2" border="0"></a>
				<a href="#down"><img src="/gspn/images/en/Bt_addline.gif" hspace="2" border="0" id=addline onClick="JAVASCRIPT:addRow();" style="cursor:hand;"></a>
                <img src="/gspn/images/en/Bt_del.gif" hspace="2" border="0" onClick="JAVASCRIPT:delRow();" style="cursor:hand;">
                </td>
              </tr>
 
			  <!--<tr>
                <td width="100%" class="count02">NARDA/Ticket No. field must be completed for Expedited shipping or "No Cool" repairs</td>
	          </tr>-->
 
              <tr>
                <td width="100%" class="count02">If you have a problem with ticket # or want expedited shipping without ticket #, please call GPCA(1-800-634-8276) call center.</td>
	          </tr>
 
            </table>
 
						<!-- Main Block E -->
          </td>
 
        </tr>
      </table>
    </td>
    </tr>
    <tr>
      <td valign="bottom"><a href="down"></a>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td class="Top"><a href="#top"><img src="/gspn/images/en/Bt_top.gif" border="0"></a></td>
          </tr>
      </table>
    </td>
  </tr>
  <input type="hidden" name="ship_method_accept" value=""> 
 </form>
</table>
 
<form name="FORM_FILE" action="ORDFileImport.jsp" method="GET"  target="">
 
<input type="hidden" name="search">
 
</form>
 
 
</body>
</html>
 
 
 
 
 
 
 
 
 
 
 
<script language="javascript"> 
    /*
    url = "/alert.html";
      w=window.open(url,"alert_popup",'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollb  ars=no,top=80,left=200,width=700,height=800');
      w.focus();
    */
</script>

Open in new window

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim ie As Object
        ie = CreateObject("internetexplorer.application")
        ie.Visible = True
        ie.navigate("https://service.samsungportal.com")
        While ie.Busy
            Application.DoEvents()
        End While
        Dim frmCol = ie.document.frames   'Get the frame collection
        Dim htmlDoc = frmCol.Item(0).document   'Get the HTML document within the frame
        htmlDoc.getElementById("userID").value = "6087721"
        htmlDoc.getElementById("UserPassWord").value = "*******"
        htmlDoc.parentWindow.execScript("checkInput();", "javascript")
        While ie.Busy
            Application.DoEvents()
        End While

        ie.navigate("http://nagspn.samsungportal.com/GSPN/gspn/ord/partorder/ORDOrder.jsp?pgmId=ORDOrder")

        
        
        ie.document.all("customer_po_number").value = "TEST"
        ie.document.all("ship_method_all").value = "T1" '  - THIS WORKS, BUT DOES NOT CALL ON CHANGE EVENT

        On Error Resume Next
        For i = 0 To ie.Document.frames.length
            ie.Document.frames(i).execscript("changeShipMethodAll('T1')", "JavaScript")
            MsgBox(Err.Number)
            If Err.Number = 0 Then
                Exit For
            End If
            Err.Number = 0
        Next
        On Error GoTo 0



        ie.document.all.dtable.rows(1).cells(1).value = "TEST" ' one attempt - ERROR (VALUE IS NOT A PROPERY OF CELLS
        ie.document.all("material").text = "TEST"  'other attempt - TEXT NOT PROPERTY OF COLLECTION
        ie.document.all.dtable.rows(1).columns(2).value = "TEST" ' third attempt - VALLUE NOT PROPERTY OF COLUMNS


        MsgBox("")

        Me.Close()




    End Sub
End Class

Open in new window

0
Comment
Question by:paulpp
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
vbigham earned 2000 total points
ID: 35743655
It looks like you just want to supply values in those html line items, is that right?

Have you tried supplying an index in this line?
ie.document.all("material").text = "TEST"  

like this:
ie.document.all("material")(0).text = "TEST"  

Just a thought in case that all of the inputs named "material" are being returned..  (Are you able to see anything like that using the debugger?)

Best of luck.
0
 
LVL 2

Author Comment

by:paulpp
ID: 35751969
Hello,

I tried your code, and I get error "Public Member 'text' on type ' HTMLTablesCellClass' not found.

Any other ideas.  Thank you again for your direction
0
 
LVL 2

Author Comment

by:paulpp
ID: 35751995
Hello vbigham,

Got it, thanks to your direction.  A table will only accept .innertext to set.  here is command.  I am giving you points.  Thanks.

ie.document.all("material")(0).innertext = "TEST"

Thank you.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month18 days, 6 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question