欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

The first time to use "javascript dom" -- Add a dynamic link

程序员文章站 2022-07-09 20:32:14
...
Requirements:
引用
Description of Enhancement

When MNR is conducting audits on industry reports have another box on the general information form for the report # that is being audited.  This can then link the two inspections together.

Analysis

An inspection report with the purpose of ‘Audit’ will be linked to one inspection report,
Add a new attribute to the foip.inspection table called audited_inspection_id. Add a new field on the New Inspection page under Purpose field call Audited Inspection Number and make it linkable so that the user can click on the number to bring up that inspection. Add the Audited Inspection Number field to the General Info Page, View All Details page, View Details page, Print page and Download page. Only show the Audited Inspection Number when the purpose of the inspection report is ‘Audit’
To help the user pick the correct inspection number use the FMU, Licence Number, approval number, to show a list of inspections. The list should contain the Inspection Date, inspection number, FMU, Block Name, Inspection Status, Inspector, Other location.  In the following format:



	function auditedInspectionNumberSelectorUpdate(ain) {
		var myForm = document.forms.inspectionGeneralInfo;
		if (ain == null)
			return ;
			
		myForm.auditedInspectionNumber.value = ain;
		
	    //<a href="http://localhost:9080/foip-app/inspectionView.do?inspectionId=2010" target="_blank"></a>
		var ainElement = document.getElementById("auditedInspectionNumber");
		var ainLink = document.createElement('a');
		var ainText = document.createTextNode(ain);
		ainLink.appendChild(ainText);
		ainLink.setAttribute("href", "<%=request.getContextPath()%>/inspectionView.do?inspectionId=" + ain);
		ainLink.setAttribute("target", "_blank");
		ainElement.parentNode.appendChild(ainLink);
	}


加拿大的森林管理系统。
相关标签: JavaScript UP