JavaScript: Pass by Value: Pass by Reference #JavaScript

JavaScript: Pass by Value: Pass by Reference From: http://sitestree.com/?p=3485
Categories:JavaScript
Tags:
Post Data:2016-07-09 23:39:28

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

JavaScript Frameworks #JavaScript

The following web-resources discuss some JavaScript Frameworks. Comparisons among the frameworks can also be found.

From: http://sitestree.com/?p=3481
Categories:JavaScript
Tags:
Post Data:2016-07-09 20:31:15

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

JavaScript Codes #JavaScript

JavaScript is a very powerful scripting language for web-site development. Also, it is in much demand.

	var serviceInstancesArrAtLoad = Array();
	var serviceInstancesArrAtSubmit = Array();
	var tempArr=Array();	
	
	function validate_required(field,alerttxt)
	{
		with (field)
		{
			if (value==null||value=='')
			{
				alert(alerttxt);return false
			}
			else {return true}
		}
	}
	
	function validateTicketCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(type,'Type must be filled out!')==
			false)
			{type.focus();return false}
			
			if (validate_required(subject,'Subject must be filled out!')
			==false)
			{subject.focus();return false}
						
		}
	}

	function validate_customer_create_form(thisform)
	{
		with (thisform)
		{
			if (validate_required(firstName,'First name must be filled 
			out!')==false)
			{firstName.focus();return false}
			
			if (validate_required(lastName,'Last name must be filled 
			out!')==false)
			{lastName.focus();return false}
			
			if (validate_required(phone,'Phone must be filled out!')==
			false)
			{phone.focus();return false}
			
		}
	}
	
	
	function validateUserCreateForm(thisform)
	{
		with (thisform)
		{
						
			if (validate_required(firstName,'First name must be filled 
			out!')==false)
			{firstName.focus();return false}
			
			if (validate_required(lastName,'Last name must be filled 
			out!')==false)
			{lastName.focus();return false}
			
			if (validate_required(shortName,'Short name must be filled 
			out!')==false)
			{shortName.focus();return false}
			
			if (validate_required(username,'Username must be filled 
			out!')==false)
			{username.focus();return false}
			
			/*
			if (validate_required(password,'Password must be filled 
			out!')==false)
			{password.focus();return false}
			
			if (password.value.length < passwordLength.value) 
			{alert("Password must be at least "+ 
			passwordLength.value +" char long");	password.focus();
			return false}
			
			if (validate_required(password2,'Please re-enter password!')
			==false)
			{password2.focus();return false}
			
			if (password.value != password2.value)
			{
				alert("Password did not match");
				password2.focus();
				return false			
			}
			*/
			
		}
	}

	function validate_assign_group_form(thisform)
	{
		with (thisform)
		{
			if (validate_required(groupId,'Group name must be filled 
			out!')==false)
			{groupId.focus();return false}
			
			if (validate_required(userId,'Action on invalid user!')==
			false)
			{userId.focus();return false}		
		}
	}
	
	function validateGroupCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(name,'Group name must be filled out!')
			==false)
			{name.focus();return false}
			
		}
	}
	
	function validateAssignGroupPermissionForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(taskId,'Task module name must be 
			filled out!')==false)
			{taskId.focus();return false}
			
		}
	}
	
	function validateAssignTaskPermissionForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(groupId,'Group name must be filled 
			out!')==false)
			{groupId.focus();return false}
			
		}
	}
	
	function validateUserEditForm(thisform)
	{
		with (thisform)
		{
						
			if (validate_required(firstName,'First name must be filled 
			out!')==false)
			{firstName.focus();return false}
			
			if (validate_required(lastName,'Last name must be filled 
			out!')==false)
			{lastName.focus();return false}
			
			if (validate_required(shortName,'Short name must be filled 
			out!')==false)
			{shortName.focus();return false}
			
			if (validate_required(username,'Login id must be filled 
			out!')==false)
			{username.focus();return false}
						
			if (password.value.length>0)
			{
				if (password.value.length < passwordLength.value) 
				{alert("Password must be at least "+ 
				passwordLength.value +" char long");	
				password.focus();return false}
				
				if (validate_required(password2,'Please re-enter 
				password!')==false)
				{password2.focus();return false}
			}
			
			if (password.value != password2.value)
			{
				alert("Password did not match");
				password2.focus();
				return false
			}
			
		}
	}
	
	function validateInventoryCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(serial,'serial must be filled out!')
			==false)
			{serial.focus();return false}
			
			if (validate_required(hardwareAddress,'Hardware Address 
			must be filled out!')==false)
			{hardwareAddress.focus();return false}
		}
	}
	
	function validateInventoryTypeCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(name,'Name must be filled out!')==
			false)
			{name.focus();return false}
		}
	}
	
	function validateInventoryModelCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(name,'Name must be filled out!')==
			false)
			{name.focus();return false}
			
			if (validate_required(manufacturerId,'Manufacturer must be
			 filled out!')==false)
			{manufacturerId.focus();return false}
			
			if (validate_required(typeId,'Type must be filled out!')==
			false)
			{typeId.focus();return false}
			
			
		}
	}
	
	function validateInventoryManufacturerCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(name,'Name must be filled out!')==
			false)
			{name.focus();return false}
		}
	}
	
	
	function validateServiceCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(name,'Name must be filled out!')==
			false)
			{name.focus();return false}
			
			if (validate_required(typeId,'Type must be filled out!')==
			false)
			{typeId.focus();return false}
			
			
		}
	}
	
	function validateHostingCreateForm(thisform)
		{
			with (thisform)
			{
				if (validate_required(serviceId,'Service must be 
				filled out!')==false)
				{serviceId.focus();return false}
				
				if (validate_required(storageSpace,'Storage space 
				must be filled out!')==false)
				{storageSpace.focus();return false}
			}
		}
		
	function validateDomainName(strValue) 
	{
		return /www.[a-z0-9_-]+.[a-z]{2, 3}/ig.test(strValue);
		
		//var objRegExp  = /^w+([.-]?w+)*(.w{2,3})/;

  		//check for valid domain
  		//return objRegExp.test(strValue);
	}
	
	function validateDomainServiceCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(name,'Domain name must be filled out!')==false)
			{name.focus();return false}
			
			/*if (validateDomainName(name.value)==false)
			{alert('Please enter valid domain name');name.focus();
			return false;}*/
			
			if (validate_required(registrar,'Registrar must be filled 
			out!')==false)
			{registrar.focus();return false}
			
			if (validate_required(registrationTimestamp,'Registration 
			timestamp must be filled out!')==false)
			{registrationTimestamp.focus();return false}
			
			if (validate_required(expiryTimestamp,'Expiry timestamp 
			must be filled out!')==false)
			{expiryTimestamp.focus();return false}
			
			if (validate_required(username,'User name must be filled 
			out!')==false)
			{username.focus();return false}
			
			if (validate_required(password,'Password must be filled 
			out!')==false)
			{password.focus();return false}
			
			if (password.value.length < passwordMinLength.value || 
			password.value.length>passwordMaxLength.value)
			{alert('Password must be '+ passwordMinLength.value+ '-'+ 
			passwordMaxLength.value +' chars long');
			password.focus();return false;}
			
			if (password.value != password2.value)
			{alert('Password must match');password2.focus();
			return false;}
		}
	}
	
	
	
	
	function validateCommunityCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(name,'Name must be filled out!')==
			false)
			{name.focus();return false}
		}
	}
	
	function validatePostalCodeCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(postalCode,'Postal code must be 
			filled out!')==false)
			{postalCode.focus();return false}
			
			if (validate_required(communityId,'Community must be 
			filled out!')==false)
			{communityId.focus();return false}
		}
	}
	
	function validateStreetTypeCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(name,'Name must be filled out!')==
			false)
			{name.focus();return false}
		}
	}
	
	function validateStreetCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(name,'Name must be filled out!')==
			false)
			{name.focus();return false}
			
			if (validate_required(typeId,'Type must be filled out!')==
			false)
			{typeId.focus();return false}
			
			if (validate_required(communityId,'Community must be filled 
			out!')==false)
			{communityId.focus();return false}
		}
	}
	
	function validateUnitCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(streetId,'Street must be filled out!')
			==false)
			{streetId.focus();return false}
			
			if (validate_required(communityId,'Community must be filled 
			out!')==false)
			{communityId.focus();return false}
			
			if (validate_required(number,'Number must be filled out!')==
			false)
			{number.focus();return false}
			
			if (validate_required(nodeId,'Node must be filled out!')==
			false)
			{nodeId.focus();return false}
			
		}
	}
	
	function validatePlantCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(name,'Name must be filled out!')==
			false)
			{name.focus();return false}
		}
	}
	
	function validateCreateTicketCategoryForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(name,'Name must be filled out!')==
			false)
			{name.focus();return false}
		}
	}
	
	
	function validateStartWorkOnTicketForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(startTimestamp,'Start Timestamp must
			 be filled out!')==false)
			{startTimestamp.focus();return false}
		}
	}
	
	function validateTicketReportForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(date,'Date must be filled out!')==
			false)
			{date.focus();return false}
		}
	}
	
	
	function validateCloseTicketForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(date,'Date must be filled out!')==
			false)
			{date.focus();return false}
			
			if (validate_required(time,'Time must be filled out!')==
			false)
			{time.focus();return false}
			
		}
	}

	function validateCreateWorkOrder(thisform)
	{
		with (thisform)
		{
			if (validate_required(inventoryId,'Inventory must be filled 
			out!')==false)
			{inventoryId.focus();return false}
			
			if (validate_required(assignedTo,'Assigned to must be 
			provided!')==false)
			{assignedTo.focus();return false}
			
			if (validate_required(scheduledDate,'Scheduled date must 
			be provided!')==false)
			{scheduledDate.focus();return false}
			
			if (validate_required(scheduledTime,'Scheduled time must 
			be provided!')==false)
			{scheduledTime.focus();return false}
			
		}
	}
	
	
	
	
	function addService(services,serviceId)
	{
		for (var i = 0; i < services.length; i++) 
		{
			if (services.options[i].selected) 
			{
				serviceIdLength = serviceId.length++;
				serviceId.options[serviceIdLength].text = 
					services.options[i].text;
				serviceId.options[serviceIdLength].value = 
					services.options[i].value;
				
			}
		}
	}
	
	
	function removeService(serviceId)
	{
		for (var i = 0; i < serviceId.length; i++) 
		{
			if (serviceId.options[i].selected) 
			{
				
				serviceId.options[i].text = '';
				serviceId.options[i].value = '';
				serviceId.options[i].selected = false;
				serviceId.options[i].remove();
			}
			
		}
		
	}
	
	function validateAssignInventoryForm()
	{
		
		var serviceArr=document.getElementsByName("serviceArr[]");
		length=serviceArr.length;
		isAnySelected = false;
		
		for (var i=0;i<length;i++) {="" if="" (servicearr[i].checked="=" true)="" isanyselected="true;" i="length;" }="" var="" servicerequested="new" array();="" inventorieshavingsameservice="new" serviceshavingsameinventory="new" isservicerequested="0;" for="" (var="" value="serviceArr[i].value;" valueelements="value.split(":");" inventory="valueElements[0];" service="valueElements[1];" serviceinstance="valueElements[2];" servicerequested[service]="serviceInstance;" (serviceinstance=""> 0)
			   isServiceRequested = 1;
			   
			if (serviceArr[i].checked == true)
			{
			   if (inventoriesHavingSameService[service] >= 0)
			   	inventoriesHavingSameService[service]=inventoriesHavingSameService[service]+1;
			   else 
			   	inventoriesHavingSameService[service]=1;
			   
			   if (servicesHavingSameInventory[inventory] > 0)
			   	servicesHavingSameInventory[inventory]=servicesHavingSameInventory[inventory]+1;
			   else
			   	servicesHavingSameInventory[inventory]=1;
			}
			
			
		}	
		if (   (!isAnySelected) && (isServiceRequested) )
		{
			alert('Service & inventory requested. But no checkbox is selected');
			return false;
		}
		else if (!isAnySelected)
		{
			var response = confirm('No checkbox is selected, do you want to proceed');
			if (!response) return false;
		}
		
		var errMsg ='';
		
		for (k=1;k<servicerequested.length;k++) {="" if="" (servicerequested[k]="">= 0 )
			{	
				if ( (serviceRequested[k] != inventoriesHavingSameService[k])  )
				{
					if (serviceRequested[k]>0) 
						errMsg = errMsg + "Inventory is not 
						checked properly for service " + k 
						+", Requested:" + serviceRequested[k] +", 
						Assigned:" + inventoriesHavingSameService[k] + "n";
					else if (serviceRequested[k]==0 && inventoriesHavingSameService[k]>0)
						errMsg = errMsg + "Inventory is not 
						checked properly for service " + k 
						+", Requested:" + serviceRequested[k] +", 
						Assigned:" + inventoriesHavingSameService[k] + "n";
				}
			}
		}
			
		if (errMsg.length>0)
		{
			alert(errMsg);
			return false;
		}
		return true;
	}
	
	//not 100% right, will fix later
	function checkDateFormat()
	{
		var pattern = new RegExp(0|1[0-9]/[0-3][0-9]/[0-9][0-9]);
		if(document.getElementById('timestampStarted').value.match(pattern))
		{
			var date_array = document.getElementById('timestampStarted').value.split('/');
			
			var month = date_array[0];
			var day = date_array[1];
			var year = date_array[2];

			// This instruction will create a date object
			source_date = new Date(year,month,day);
	
			if(month != source_date.getMonth())
			{
				alert('Month is not valid!');
				return false;
			}
	
			if(day != source_date.getDate())
			{
				alert('Day is not valid!');
				return false;
			}
			
			if(year != source_date.getYear())
			{
				alert('Year is not valid!');
				return false;
			}
		}
		else
		{
			alert('Date format is not valid!');
			return false;
		}
	
		return true;
	}

	//used by assignService.php
	function initializeServiceInstanceArr()
	{
		if (serviceInstancesArrAtLoad.length == 0)
			serviceInstancesArrAtLoad=document.getElementsByName("serviceInstances[]");
		length=serviceInstancesArrAtLoad.length;

		for(i=0;i<length;i++) {="" temparr[i]="serviceInstancesArrAtLoad[i].value;" }="" used="" by="" assignservice.php="" temparr="" is="" filled="" up="" at="" the="" page="" load="" and="" function="" validateassignserviceform(thisform,serviceid)="" var="" flag="false;" with="" (thisform)="" if="" (validate_required(timestampstarted,'start="" date="" must="" be="" out!')="=false)" {timestampstarted.focus();return="" false}="" (checkdateformat()="=false)" {return="" serviceinstancesarratsubmit="document.getElementsByName("serviceInstances[]");" length="serviceInstancesArrAtSubmit.length;" for="" (var="" i="0;i<length;i++)" (serviceinstancesarratsubmit[i].value="" !="tempArr[i])" break;="" (flag)="" service="" id="" checked="" otherwise="" data="" will="" not="" passed="" to="" php="" scripts="" <="" serviceid.length;="" i++)="" serviceid.options[i].selected="true;" return="" true;="" else="" alert('nothing="" has="" been="" changed');="" false;="" checkallinventories2(serviceid)="" servicecheckall="document.getElementsByName("serviceCheckAll[]");" inventorycheckall="document.getElementsByName("inventoryCheckAll[]");" servicearr="document.getElementsByName("serviceArr[]");" lengthinventorycheckall="inventoryCheckAll.length;" lengthservicearr="serviceArr.length;" status="false;" (i="0;i<length;i++)" (servicecheckall[i].value="=serviceId)" lengtharr="serviceArr.length;" (j="0;j<lengthArr;j++)" value="serviceArr[j].value;" valueelements="value.split(':');" (valueelements[1]="=serviceId)" servicearr[j].checked="status;" servicecheckall.checked;="" !servicearr[j].checked;="" (status="=false)" inventoryid="valueElements[0];" alert(inventoryid);="" alert(lengthinventorycheckall);="" (inventorycheckall[i].value="=inventoryId)" inventorycheckall[i].checked="false;" (k="0;k<lengthServiceArr;k++)" value2nd="serviceArr[k].value;" valueelements2nd="value2nd.split(':');" (valueelements2nd[0]="=inventoryId)" (servicearr[k].checked="=false)" (flag="=true)" checkallservices2(inventoryid)="" lengthservicecheckall="serviceCheckAll.length;" (valueelements[0]="=inventoryId)" serviceid="valueElements[1];" servicecheckall[i].checked="false;" (valueelements2nd[1]="=serviceId)" validateemail(="" strvalue)="" objregexp="/(^[a-z]([a-z_.]*)@([a-z_.]*)([.][a-z]{3})$)|" (^[a-z]([a-z_.]*)@([a-z_.]*)="" (.[a-z]{3})(.[a-z]{2})*$)="" i;="" check="" valid="" email="" objregexp.test(strvalue);="" validateemailcreationform(thisform)="" (validate_required(email,'email="" {email.focus();return="" (validate_required(domain,'email="" domain="" {domain.focus();return="" *emailaddr="email.value+'@'+domain.value;" alert(emailaddr);="" (validateemail(emailaddr)="=false)" {alert('please="" provide="" address');email.focus();return="" false;}*="" (validate_required(password,'password="" {password.focus();return="" (validate_required(password2,'please="" re-enter="" password!')="=false)" {password2.focus();return="" (password.value="" {alert('passwords="" match');password2.focus();return="" *if="" (forwardaddress.value.length="">0 )
			{
				var forwardAddresses = forwardAddress.value.split(',');
				var length=forwardAddresses.length;
				for(var i=0;i<length;i++) {="" alert(forwardaddresses[i]);="" if="" (validateemail(forwardaddresses[i])="=false)" {alert('please="" provide="" valid="" forward="" address');forwardaddress.focus();return="" false;}="" }="" }*="" function="" validatenodecreateform(thisform)="" with="" (thisform)="" (validate_required(name,'name="" must="" be="" filled="" out!')="=false)" {name.focus();return="" false}="" *if="" (validate_required(communityid,'community="" {communityid.focus();return="" false}*="" validatedocsisnodecreateform(thisform)="" (validate_required(nodeid,'node="" {nodeid.focus();return="" (validate_required(docsisservicegroupid,'docsis="" service="" group="" id="" {docsisservicegroupid.focus();return="" validateaddtowhiteblacklistform(thisform)="" (validate_required(email,'email="" {email.focus();return="" (validate_required(addto,'add="" to="" {addto.focus();return="" (validateemail(email.value)="=false)" email="" address');email.focus();return="" var="" passstr="&email=" +email.value+'&addto="+addTo.value+" &emailid="+emailId.value;
			expandtab(" maintab',11,passstr);="" validatealiascreateform(thisform)="" (validate_required(alias,'alias="" {alias.focus();return="" (validate_required(destination,'destination="" {destination.focus();return="" ajaxfunction()="" page_request="false" (window.xmlhttprequest)="" mozilla,="" ie7,="" safari="" etc="" xmlhttprequest()="" else="" (window.activexobject)="" ie="" try="" activexobject("msxml2.xmlhttp")="" catch="" (e)="" activexobject("microsoft.xmlhttp")="" return="" false="" page_request;="" changemodeloptions()="" (!page_request)="" false;="" manufacturerid="document.getElementById('manufacturerId');" modelid="document.getElementById('modelId');" lengthmodelid="modelId.options.length;" modelid.removeall();="" page_request.onreadystatechange="function()" if(page_request.readystate="=4)" modelids="page_request.responseText;" modelidarr="modelIds.split('~');" length="modelIdArr.length;" while(modelid.options.length="">=1)
				{
					lengthModelId=modelId.options.length;
					modelId.options[lengthModelId-1]=null;
				}
      
        		for(var i=0;i<length-1;i++) {="" values="modelIdArr[i].split(':');" var="" newoption="document.createElement("option");" newoption.value="values[0];" newoption.innerhtml="values[1];" modelid.appendchild(newoption);="" }="" page_request.open('get',="" '="" inventory="" changemodelslist.php?manufacturerid="+manufacturerId.value, true)
		page_request.send(null)
	}
	
	function ajaxFunctionGeneral()
	{
		var page_request = false

		if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc
			page_request = new XMLHttpRequest()
		else if (window.ActiveXObject)
		{ // if IE
			try 
			{
				page_request = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e)
			{
				try
				{
					page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e)
				{
				}
			}
		}
		else		
			return false
		return page_request;
	}

	function reboot(deviceId)
	{
		var response=confirm(" are="" you="" sure="" to="" reboot');="" if(!response)="" exit;="" page_request="ajaxFunctionGeneral();" if="" (!page_request)="" return="" false;="" page_request.onreadystatechange="function()" if(page_request.readystate="=4)" response="page_request.responseText;" displayarea="document.getElementById('showDiagnosticsResults');" displayarea.value="response;" diagnostics="" reboot.php?deviceid="+deviceId, true)
		page_request.send(null)
	}
	
	function standBy(deviceId)
	{
		page_request = ajaxFunctionGeneral();
		if (!page_request) return false;
		
		page_request.onreadystatechange=function()
      {
      	if(page_request.readyState==4)
        	{
        		var response=page_request.responseText;
        		var displayArea = document.getElementById(" showdiagnosticsresults');="" standbystatus.php?deviceid="+deviceId, true)
		page_request.send(null)
	}
	
	function changeIpDomainAddress()
	{
		page_request = ajaxFunctionGeneral();
		if (!page_request) return false;				
		var serverTypeId=document.getElementById(" servertypeid');="" addressid="document.getElementById('addressId');" addressidlength="addressId.options.length;" modelid.removeall();="" addressids="page_request.responseText;" addressidarr="addressIds.split('~');" length="addressIdArr.length;" while(addressid.options.length="">=1)
				{
					lengthAddressId=addressId.options.length;
					addressId.options[lengthAddressId-1]=null;
				}
      
        		for(var i=0;i<length-1;i++) {="" values="addressIdArr[i].split(':');" var="" newoption="document.createElement("option");" newoption.value="values[0];" newoption.innerhtml="values[1];" addressid.appendchild(newoption);="" }="" page_request.open('get',="" '="" service="" changeipdomainaddress.php?servertypeid="+serverTypeId.value, true)
		page_request.send(null)
	}

	
	
	function validateHostingAdministrationForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(serviceName," name="" must="" be="" filled="" out!')="=false)" {servicename.focus();return="" false}="" if="" (validate_required(servertypeid,'server="" type="" {servertypeid.focus();return="" function="" validateinventorytypeassignform(thisform)="" with="" (thisform)="" (validate_required(manufacturerid,'manufacturer="" {manufacturerid.focus();return="" (validate_required(modelid,'model="" {modelid.focus();return="" (validate_required(typeid,'type="" {typeid.focus();return="" refreshcanopydiagnostics(id,inventoryid)="" page_request="ajaxFunctionGeneral();" (!page_request)="" return="" false;="" page_request.onreadystatechange="function()" if(page_request.readystate="=4)" response="page_request.responseText;" displayarea="document.getElementById('ajaxcontentarea');" displayarea.innerhtml="response;" inventory="" canopydiagnostics.php?id="+id+" &inventoryid="+inventoryId, true)
		page_request.send(null)
	}
	
	function validateDocsisNodeCreateForm(thisform) 
	{
		with (thisform)
		{
			if (validate_required(nodeName," node="" {nodename.focus();return="" (validate_required(docsisservicegroupid,'docsis="" group="" {docsisservicegroupid.focus();return="" validatedocsisdhcpaddresscreateform(thisform)="" with(thisform)="" (validate_required(startipaddress,'start="" ip="" address="" {startipaddress.focus();return="" (validate_required(cmtsinterfacebundleid,'cmts="" interface="" bundle="" {cmtsinterfacebundleid.focus();return="" validatedocsiscmtscreateform(thisform)="" (validate_required(name,'name="" {name.focus();return="" (validate_required(ipaddress,'ip="" {ipaddress.focus();return="" (validate_required(cmtscommunitystring,'community="" string="" {cmtscommunitystring.focus();return="" (validate_required(modemcommunitystring,'modem="" {modemcommunitystring.focus();return="" validatecmtsspeedcreateform(thisform)="" (validate_required(speed,'speed="" {speed.focus();return="" services="" changeservices()="" servicetypeid="document.getElementById('serviceTypeId');" serviceid="document.getElementById('serviceId');" lengthserviceid="serviceId.options.length;" modelid.removeall();="" (page_request.readystate="=4)" serviceids="page_request.responseText;" serviceidarr="serviceIds.split('~');" length="serviceIdArr.length;" while(serviceid.options.length="">=1)
				{
					lengthServiceId=serviceId.options.length;
					serviceId.options[lengthServiceId-1]=null;
				}
      
        		for(var i=0;i<length-1;i++) {="" values="serviceIdArr[i].split(':');" var="" newoption="document.createElement("option");" newoption.value="values[0];" newoption.innerhtml="values[1];" serviceid.appendchild(newoption);="" }="" page_request.open('get',="" '="" service="" changeserviceslist.php?servicetypeid="+serviceTypeId.value, true)
		page_request.send(null)
	}
	
	function validateServiceSpeedAssignForm(thisForm)
	{
		with(thisForm)
		{
			if (validate_required(serviceId," type="" &="" must="" be="" filled="" out!')="=false)" {serviceid.focus();return="" false}="" if="" (validate_required(cmtsspeedid,'cmts="" speed="" {cmtsspeedid.focus();return="" docsis="" function="" validatedocsisservicegroupcreateform(thisform)="" with="" (thisform)="" (validate_required(cmtsvlan,'dhcp="" vlan="" {cmtsvlan.focus();return="" (validate_required(cmtsinterfacename,'interface="" name="" {cmtsinterfacename.focus();return="" (validate_required(cmtsinterfacebundleid,'interface="" bundle="" {cmtsinterfacebundleid.focus();return="" validatedocsisinterfacebundlecreateform(thisform)="" with(thisform)="" (validate_required(name,'interface="" {name.focus();return="" (validate_required(docsiscmtsid,'docsis="" cmts="" {docsiscmtsid.focus();return="" (validate_required(cmtsvlanaddress,'cmts="" address="" {cmtsvlanaddress.focus();return="" validatedocsisinventorycreateform(thisform)="" (validate_required(inventorymodelid,'inventory="" model="" {inventorymodelid.focus();return="" (validate_required(docsisversion,'docsis="" version="" {docsisversion.focus();return="" validatedocsisservicecreateform(thisform)="" (validate_required(serviceid,'service="" (validate_required(downloadspeed,'download="" {downloadspeed.focus();return="" *if="" (validate_required(uploadspeed,'upload="" {uploadspeed.focus();return="" false}*="" validatedocsissettingcreateform(thisform)="" (validate_required(customerid,'customer="" {customerid.focus();return="" (validate_required(overrideconfigfile,'override="" config="" file="" {overrideconfigfile.focus();return="" hosting="" validatecustomerhostingparameters(thisform)="" (validate_required(domainid,'domain="" {domainid.focus();return="" validatehostingsiteusercreateform(thisform)="" (validate_required(username,'site="" user="" {username.focus();return="" (validate_required(password,'site="" password="" {password.focus();return="" (="" password.value.length="" <="" passwordminlength.value="" )="" alert('password="" length="" should="" at="" least="" '+passwordminlength.value);="" password.focus();return="" false="" (password.value.length=""> passwordMaxLength.value)
			{alert('Password length should be <= '+passwordMaxLength.value );
			password.focus();return false}
			
						
			if (validate_required(password2,'Please re-enter site password !')==false)
			{password2.focus();return false}
			
			if (password.value != password2.value)
			{
				alert("Site User Passwords must match");
				password2.focus();
				return false
			}
		}
	}
	
	function validateHostingDomainUserCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(domainId,'Domain name must be 
			filled out!')==false)
			{domainId.focus();return false}
			
			
			if (validate_required(username,'Domain user name must 
			be filled out!')==false)
			{username.focus();return false}
			
			if (validate_required(password,'Domain password must be 
			filled out!')==false)
			{password.focus();return false}
						
			if ( password.value.length  < passwordMinLength.value )
			{ alert('Password length should be at least '+passwordMinLength.value); 
			  password.focus();return false }
			
			if (password.value.length  > passwordMaxLength.value)
			{alert('Password length should be <= '+passwordMaxLength.value );
                         password.focus();return false}
			
			
			if (validate_required(password2,'Please re-enter site password !')==false)
			{password2.focus();return false}
			
			if (password.value != password2.value)
			{
				alert("Domain User Passwords must match");
				password2.focus();
				return false
			}
		}
	}
	
	
	//outage
	function validateOutageCreateForm(thisform)
	{
		with (thisform)
		{
			if (validate_required(subject,'Subject must be filled out!')==false)
			{subject.focus();return false}
			
			//check community selection
			var communityNamesArr=document.getElementsByName("communityNames[]");
			lengthArr= communityNamesArr.length;			
			var isAnySelected = false;
			
			for (var i=0;i

  From: http://sitestree.com/?p=3479
Categories:JavaScript
Tags:
Post Data:2016-07-09 20:33:19

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

JavaScript – Miscellaneous Validations #JavaScript

function validateDomainName(strValue)

	{

								
		return /www.[a-z0-9_-]+.[a-z]{2, 3}/ig.test(strValue);		
	}

	function validateDomainName(strValue) 
	{
		return /www.[a-z0-9_-]+.[a-z]{2, 3}/ig.test(strValue);		
	}


	//not 100% right, will fix later
	function checkDateFormat()
	{
		var pattern = new RegExp(0|1[0-9]/[0-3][0-9]/[0-9][0-9]);
		if(document.getElementById('timestampStarted').value.match(pattern))
		{
			var date_array = document.getElementById('timestampStarted').value.split('/');
			
			var month = date_array[0];
			var day = date_array[1];
			var year = date_array[2];

			// This instruction will create a date object
			source_date = new Date(year,month,day);
	
			if(month != source_date.getMonth())
			{
				alert('Month is not valid!');
				return false;
			}
	
			if(day != source_date.getDate())
			{
				alert('Day is not valid!');
				return false;
			}
			
			if(year != source_date.getYear())
			{
				alert('Year is not valid!');
				return false;
			}
		}
		else
		{
			alert('Date format is not valid!');
			return false;
		}
	
		return true;
	}



	function validateEmail( strValue) 
	{
		var objRegExp  = /(^[a-z]([a-z_.]*)@([a-z_.]*)([.][a-z]{3})$)|(^
                [a-z]([a-z_.]*)@([a-z_.]*)(.[a-z]{3})(.[a-z]{2})*$)/i;

  		//check for valid email
  		return objRegExp.test(strValue);
	}


	//AJAX Example
	function ajaxFunctionGeneral()
	{
		var page_request = false

		if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc
			page_request = new XMLHttpRequest()
		else if (window.ActiveXObject)
		{ // if IE
			try 
			{
				page_request = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e)
			{
				try
				{
					page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e)
				{
				}
			}
		}
		else		
			return false
		return page_request;
	}

	function reboot(deviceId)
	{
		var response=confirm('Are you sure to reboot');
		
		if(!response)
			exit;
		
		page_request = ajaxFunctionGeneral();
		if (!page_request) return false;
		
		page_request.onreadystatechange=function()
      {
      	if(page_request.readyState==4)
        	{
        		var response=page_request.responseText;
        		var displayArea = document.getElementById('showDiagnosticsResults');
        		displayArea.value = response;
        	}
      }
		page_request.open('GET', '/Inventory/Diagnostics/reboot.php?deviceId='+deviceId, true)
		page_request.send(null)
	}

From: http://sitestree.com/?p=3477
Categories:JavaScript
Tags:
Post Data:2016-07-09 20:34:58

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

#Engineering: #Canada: #Job/Contract/Project: Any #Engineering: #Computer, #Electrical, #Electronics, #Civil, #Chemical, #Mechanical, #Naval, #Biomedical, and misc Engineering

Date Posted:2021-07-15 .Apply yourself, or submit others as candidates; Build a recruitment team to submit others as candidates; submit RFP to be considered for projects in future; Try to become a vendor so that you are asked to submit consultants/resources in future. If these work for you. This list is posted in this blog everyday provided there are new projects under the criteria

  1. electrical-and-electronics-10006
  2. Electrical Wire Products
  3. Fleet Lighting and Electrical Components
  4. transportation-equipment-and-spares-10029
  5. Fleet Lighting and Electrical Components
  6. architect-and-engineering-services-10048
  7. Architectural & Engineering Services for Ilavut Centre Renovation
  8. Architectural and Engineering Services
  9. Engineering and Architectural Services
  10. Engineering and Architectural Services
  11. Consultants for Detailed Design and Engineering Services For Active Transportation Infrastructure
  12. RFP for ENGINEERING DESIGN CONSULTANT SERVICES for CALGARY REMAND CENTRE Replace Compressors and Water Cooled Chiller for Kitchen Cooler, Replace HVAC System
  13. Engineering Services Tender 2021 & QA for Gravel Crushing
  14. Engineering Services for Intersection Improvement Program
  15. environmental-services-10050
  16. Prime Consultant Landscape Architecture or Civil Engineering Consultant Services for David Thompson Corridor Infrastructure Safety Upgrades
  17. operation-of-government-owned-facilities-10039
  18. Engineering Services for Intersection Improvement Program
  19. Owner’s Engineering Services for the Bow River Bridge
  20. professional-administrative-and-management-support-services-10040
  21. Engineering and Architectural Services
  22. research-and-development-r-d-10036
  23. Software reverse engineering prototypes development (W7701-217332/A)
  24. Engineering Services for Intersection Improvement Program
  25. special-studies-and-analysis-not-r-d-10047
  26. Engineering and Architectural Services
  27. Keywords Used:engineer,civil,mechanical,electrical,electronics,mechatronics,naval,biomedical,computer engineer,software engineer,civil engineer,biomedical,electrical engineer,electronics engineer,mechanical engineer,metallurgical,chemical engineer,industrial engineer,communications engineer,quality assurance engineer,Aerospace engineer,aeronautical engineer,Engineering manager,Agricultural Engineer,Automotive Engineer,Environmental Engineer,Geological Engineer,Marine Engineer,Petroleum Engineer,Acoustic Engineer,Acoustic Engineer,Aerospace Engineer,Agricultural Engineer,Applied Engineer,Architectural Engineer,Audio Engineer,Automotive Engineer,Biomedical Engineer,Chemical Engineer,Civil Engineer,Computer Engineer,Electrical Engineer,Environmental Engineer,Industrial Engineer,Marine Engineer,Materials Science Engineer,Mechanical Engineer,Mechatronic Engineer,Mining and Geological Engineer,Molecular Engineer,Nanoengineering,Nuclear Engineer,Petroleum Engineer,Software Engineer,Structural Engineer,Telecommunications Engineer,Thermal Engineer,Transport Engineer,Vehicle Engineer,engineering

    #Canada: #IT Jobs:#Consultants, #Contractors, #Analysts, #Engineers, #Developers, #Technology Consultants, #IT-Consultants Opportunities2021-07-15

    Apply yourself, or submit others as a candidate, Build a recruitment team to submit others as a candidate, submit RFP to be considered for projects in future, Try to become a vendor so that you are asked to submit consultants/resources in future

    1. construction-services-10004
    2. Prime Consultant Architectural Services Social Sciences Bldg. Façade Replacement
  28. energy-10007
  29. Source List (SL) for Environmental Consulting Services
  30. Prime Consultant for Main Building Foundation Repairs & Site Grading
  31. fire-fighting-security-and-safety-equipment-10010
  32. Source List (SL) for Environmental Consulting Services
  33. architect-and-engineering-services-10048
  34. Consultant Team for Bridgeland Place – Affordable Housing
  35. Prime Consultant Architectural Services Social Sciences Bldg. Façade Replacement
  36. REQUEST FOR PROPOSAL (RFP) for PRIME CONSULTANT SERVICES for EDMONTON – YELLOWHEAD YOUTH CENTER CAMPUS UPGRADES
  37. RFP for ENGINEERING DESIGN CONSULTANT SERVICES for CALGARY REMAND CENTRE Replace Compressors and Water Cooled Chiller for Kitchen Cooler, Replace HVAC System
  38. REQUEST FOR PROPOSAL (RFP) for PRIME CONSULTANT SERVICES for EVANSBURG – GRAND TRUNK K-12 SCHOOL MODERNIZATION (SOLUTION FOR EVANSBURG AND WILDWOOD) 2021 School Capital Announcement
  39. communications-photographic-mapping-printing-and-publication-services-10042
  40. Environmental and Survey Consultant Services for Highway-774 Wildlife Road Crossing Study and Fence Line Survey
  41. PQR for Destination Development, Management Research and Analytic Consulting Services
  42. PQR for Research and Analytic Consulting Services
  43. educational-and-training-services-10043
  44. Anti-Racism & Anti-Discrimination Exploratory Working Group (AREWG) Consultant
  45. environmental-services-10050
  46. Environmental and Survey Consultant Services for Highway-774 Wildlife Road Crossing Study and Fence Line Survey
  47. Prime Consultant Landscape Architecture or Civil Engineering Consultant Services for David Thompson Corridor Infrastructure Safety Upgrades
  48. Consulting Services for Mill Creek Improvements
  49. financial-and-related-services-10038
  50. RQQ-2020-FACA-499: VOR + 2nd Stage- Provide Accounting & Tax Consulting Services
  51. Request for Proposal (RFP) for Actuarial and Pension Consulting Services
  52. health-and-social-services-10052
  53. Psychology Consulting and Quality Assurance Services
  54. information-processing-and-related-telecommunications-services-10049
  55. REFONTE DES SITES WEB
  56. Consultant Services for an Information Technology Strategic Plan (ITSP)
  57. Consulting Services: Connected Community Strategy
  58. Environmental and Survey Consultant Services for Highway-774 Wildlife Road Crossing Study and Fence Line Survey
  59. research-and-development-r-d-10036
  60. Specialist Environmental Consulting Services
  61. special-studies-and-analysis-not-r-d-10047
  62. CONSULTING SERVICES FOR STREETSCAPE ASSESSMENT
  63. Anti-Racism & Anti-Discrimination Exploratory Working Group (AREWG) Consultant
  64. Consulting Services – Construction Material Salvage & Recycling Market Assessment
  65. undefined-10055
  66. RQQ-2020-FACA-499: VOR + 2nd Stage- Provide Accounting & Tax Consulting Services
  67. EPS/BLRS Web Surveillance Solution for Short-Term Rentals in the City of Ottawa
  68. #Sensor: #Canada: #Job/Contract/Project: #Sensor, #Tracking, #Fusion, #Estimation, #Surveillance, #sensor network, #target #tracking, #security 2021-07-15

    Date Posted:2021-07-15 .Apply yourself, or submit others as candidates; Build a recruitment team to submit others as candidates; submit RFP to be considered for projects in future; Try to become a vendor so that you are asked to submit consultants/resources in future. If these work for you. This list is posted in this blog everyday provided there are new projects under the criteria

    1. armament-10027
    2. Signal Smoke Marine, Orange (W8486-217390/A)
    3. electrical-and-electronics-10006
    4. Surveillance of Space 2 RFI (W8474-187639/C)
    5. fire-fighting-security-and-safety-equipment-10010
    6. SURVEILLANCE SYSTEM – Fisher Court – 401 Fourth Avenue W, Geraldton, 401R Fourth Avenue W, Geraldton & Collingwood Court, 610 Winnipeg Street, Schreiber
    7. SURVEILLANCE SYSTEM – 1908, 1930,1940 FREDERICA STREET
    8. Regional headquarters security platform upgrade
    9. maintenance-repair-modification-rebuilding-and-installation-of-goods-equipment-10054
    10. Traffic Signal and Pedestrian Crossover Installations
    11. research-and-development-r-d-10036
    12. ITS Operational Security Services
    13. undefined-10055
    14. EPS/BLRS Web Surveillance Solution for Short-Term Rentals in the City of Ottawa
    15. Keywords Used:sensor,fusion,sensor network,tracking,target tracking,surveillance,self driving car,self-driving,estimation,security,signal processing,image processing,autonomouse vehicle,facial recognition,signal,recognition,sensor fusion

      JavaScript – Form validation #JavaScript

      The code will be helpful in validating data entry forms such as: user registration, user creati on. validate_required is used by all other functions

      function validate_required(field,alerttxt)
      	{
      		with (field)
      		{
      			if (value==null||value=='')
      			{
      				alert(alerttxt);return false
      			}
      			else {return true}
      		}
      	}
      	
      	function validateTicketCreateForm(thisform)
      	{
      		with (thisform)
      		{
      			if (validate_required(type,'Type must be filled out!')==false)
      			{type.focus();return false}
      			
      			if (validate_required(subject,'Subject must be filled out!')==false)
      			{subject.focus();return false}
      						
      		}
      	}
      
      	function validate_customer_create_form(thisform)
      	{
      		with (thisform)
      		{
      			if (validate_required(firstName,'First name must be filled out!')==false)
      			{firstName.focus();return false}
      			
      			if (validate_required(lastName,'Last name must be filled out!')==false)
      			{lastName.focus();return false}
      			
      			if (validate_required(phone,'Phone must be filled out!')==false)
      			{phone.focus();return false}
      			
      		}
      	}
      	
      	
      	function validateUserCreateForm(thisform)
      	{
      		with (thisform)
      		{
      						
      			if (validate_required(firstName,'First name must be filled out!')==false)
      			{firstName.focus();return false}
      			
      			if (validate_required(lastName,'Last name must be filled out!')==false)
      			{lastName.focus();return false}
      			
      			if (validate_required(shortName,'Short name must be filled out!')==false)
      			{shortName.focus();return false}
      			
      			if (validate_required(username,'Username must be filled out!')==false)
      			{username.focus();return false}
      			
      			
      			if (validate_required(password,'Password must be filled out!')==false)
      			{password.focus();return false}
      			
      			if (password.value.length < passwordLength.value) {alert("Password must be
                    at least " + passwordLength.value +" char long");
      	password.focus();return false}
      			
      			if (validate_required(password2,'Please re-enter password!')==false)
      
      			{password2.focus();return false}
      			
      			if (password.value != password2.value)
      			{
      				
      alert("Password did not match");
      
      				password2.focus();
      				return false			
      			}
      			
      			
      		}
      	}
      

      From: http://sitestree.com/?p=3475
      Categories:JavaScript
      Tags:
      Post Data:2016-07-09 20:36:29

      Shop Online: https://www.ShopForSoul.com/
      (Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
      In Bengali: http://Bangla.SaLearningSchool.com
      http://SitesTree.com
      8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
      Shop Online: https://www.ShopForSoul.com/
      Medium: https://medium.com/@SayedAhmedCanada

      JavaScript by Example #JavaScript

      JavaScript by Example:

      Example 1.1 A si mple JavaScript program Run View Source
      Example 1.2 An HTML form with a JavaScript event handler defined Run View Source
      Example 1.3 Estimating Your Taxes with JavaScript Run View Source
      Example 6.1 Defining JavaScript Functions View Source
      Example 6.2 Using Functions as Data View Source
      Example 6.3 Checking for the Correct Number of Arguments View Source
      Example 6.4 A Multi-Argument max() Function View Source
      Example 6.5 Creating and Initializing an Array View Source
      Example 6.6 Using Static Variables View Source
      Example 7.1 A Rectangle Object Constructor Function View Source
      Example 7.2 Defining and Invoking a Method View Source
      Example 7.3 Defining Methods in a Constructor View Source
      Example 7.4 Defining a Class with a Prototype Object View Source
      Example 7.5 Defining instance/class variables and methods View Source
      Example 7.6 Defining and using the valueOf() method View Source
      Example 8.1 An Array Constructor View Source
      Example 9.1 Copying, Passing, and Comparing by Value View Source
      Example 9.2 Copying, Passing, and Comparing by Reference View Source
      Example 9.3 References Themselves are Passed by Value View Source
      Example 9.4 Are Strings and Functions Compared by Value or Reference? Run View Source
      Example 9.5 The assign() Method View Source
      Example 10.1 A Simple JavaScript Program in an HTML File Run View Source
      Example 12.1 Using the alert(), confirm() and prompt() methods Run View Source
      Example 12.2 Displaying and Reporting JavaScript Errors with a Run View Source
      Example 12.3 Displaying a link’s destination in the status line Run View Source
      Example 12.4 A digital clock in the status line Run View Source
      Example 12.5 Creating an invisible frame View Source
      Example 12.6 Dynamically creating and animating frames Run View Source
      Example 13.1 Getting Browser Version Information View Source
      Example 13.2 Extracting Arguments from a URL View Source
      Example 13.3 A Navigation Bar Using the History and Location Objects View Source
      Example 14.1 Creating a plain-text document Run View Source
      Example 14.2 Generating XBM images with JavaScript Run View Source
      Example 14.3 Listing the Links in a Document View Source
      Example 14.4 A Random Hypertext Link View Source
      Example 14.5 Invoking Methods of a Java applet from JavaScript View Source
      Example 15.1 A Utility Class for Working with Cookies Run View Source
      Example 16.1 An Animation Using Image Replacement Run View Source
      Example 16.2 An Animation Using the onLoad() Event Handler Run View Source
      Example 16.3 Implementing a Toggle Button with Image Replacement Run View Source
      Example 17.1 An HTML Form Containing all Form Elements Run View Source
      Example 17.2 Performing Form Validation Run View Source
      Example 18.1 A Script Hidden from Old Browsers View Source
      Example 18.2 Displaying a Message on non-JavaScript Browsers View Source
      Example 18.3 Loading a JavaScript-based page only if JavaScript is supported View Source
      Example 18.4 Displaying a Message with <NOSCRIPT> View Source
      Example 18.5 Displaying a Message for Browsers that do not Support JavaScript 1.1 View Source
      Example 18.6 A Web Page to test for JavaScript Compatibility View Source
      Example 18.7 Displaying a Failure Message when using <SCRIPT SRC=> View Source
      Example 19.1 Scripting the built-in Java classes Run View Source
      Example 19.2 Controlling an Applet with JavaScript View Source
      Example 19.3 Controlling a Plug-in from JavaScript Run View Source
      Example 19.4 Using JavaScript from an Applet Method View Source
      Example 19.5 A Java OutputStream for Displaying HTML in a Browser Window View Source

      Reference: From: http://sitestree.com/?p=3473
      Categories:JavaScript
      Tags:
      Post Data:2016-07-16 13:37:04

      Shop Online: https://www.ShopForSoul.com/
      (Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
      In Bengali: http://Bangla.SaLearningSchool.com
      http://SitesTree.com
      8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
      Shop Online: https://www.ShopForSoul.com/
      Medium: https://medium.com/@SayedAhmedCanada

      Handling Checkbox arrays with Javascript::GetElementsByName:XHTML supported #JavaScript

      The following code demonstrates how to handle checkboxes with JavaScript. Note the names of all c heck boxes are same myInput[]. It could also be myInput. Both works as an array to contain the controls’ values. I prefer myInput[] as you can handle this control in PHP as an array. If you use $arr=$_POST[‘myInput’], $arr will contain the values of the controls.

      Note the use of getElementsByName(). It is easy to manipulate JavaScript controls using this name. You do not need to send a value/control to the function. And in many times, document.myform.control, does not work right, specially if you want to main XHTML standard[i need to check more on this]. getElementById is also very useful. You may use getElementById for most times, but with checkbox arrays getElementsByName is better choice.

      Also, note that when a form is submitted only the values of the checked check boxes are submitted to the server. You may wish to use hidden controls to keep the values, so that all values are submitted and based on the checked/non-checked you can ..control your work

      <html>
      	<head>
      		<script type="text/javascript">
      			function getElements()
      			  {
      			  var x=document.getElementsByName("myInput[]");
      			  alert(x.length);
      			  alert(x[0].value);
      			  alert(x[1].value);
      			  alert(x[2].value);
      
      
      			  }
      		</script>
      </head>
      
      <body>
      	<input name="myInput[]" type="checkbox" size="20" value='10'/>10 
      	<input name="myInput[]" type="checkbox" size="20" value='20' />20
      	<input name="myInput[]" type="checkbox" size="20" value='30' />30

      From: http://sitestree.com/?p=3471
      Categories:JavaScript
      Tags:
      Post Data:2016-07-09 20:37:45

      Shop Online: https://www.ShopForSoul.com/
      (Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
      In Bengali: http://Bangla.SaLearningSchool.com
      http://SitesTree.com
      8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
      Shop Online: https://www.ShopForSoul.com/
      Medium: https://medium.com/@SayedAhmedCanada