Hi all,

I am trying to show a field based on another field's value and hide it it initially... like when you want students to select their schools if they have gone for education ortherwise the school field remains inactive...

I have the folowing scipt but it is not being fired on page load... I don't know where am going wrong....

<script type="text/javascript">

function OnPageLoadAdd(pageid)
{
var tName = 'dbo.Register';
var ctrleducation = Runner.controls.ControlManager.getAt(tName, pageid, 'education');
var ctrlCollage = Runner.controls.ControlManager.getAt(tName, pageid, 'Collage');

ctrleducation.on('change', function(e){
     if (this.getValue() == 'yes'){
          ctrlCollage.setEnabled();
          ctrlCollage.addValidation("IsRequired");
     }else{
          ctrlCollage.setDisabled();
          ctrlCollage.setValue("");
          ctrlCollage.removeValidation("IsRequired");
     }
});
}
</script>

Any help would be highly appreciated..

Is this JQuery or PHP??? Something doesn't look right.

Hi, sorry for late reply, I use asprunner version 6.2 application, am not good in ASP and it uses Javascript onload, which apparently is not firing and their help forum is not good either...

Regards,

Erick

We would need more information like where you are adding OnPageLoadAdd() handler.

Hi,

I have tried adding it on the header, at the end just before the </body> closing tag, I have even tried using the <body onload = ''> concept but no action, let me know if there is need for the codes for the register.asp...

yes put register.asp if possible

Hi,

Here it is, it is quite long...

<%
%>
<!--#include file="include/dbcommon.asp"-->
<%
asp_header "Expires: Thu, 01 Jan 1970 00:00:01 GMT"
asp_header "Pragma: no-cache"
asp_header "Cache-Control: no-cache"
asp_include "include/Register_variables.asp",false
asp_include "include/xtempl.asp",false
asp_include "classes/runnerpage.asp",false
filename = ""
status = ""
message = ""
mesClass = ""
usermessage = ""
error_happened = false
readavalues = false
Set keys = (CreateDictionary())
Set showKeys = (CreateDictionary())
Set showValues = (CreateDictionary())
Set showRawValues = (CreateDictionary())
Set showFields = (CreateDictionary())
Set showDetailKeys = (CreateDictionary())
IsSaved = false
HaveData = true
doAssignment sessionPrefix,strTableName
if IsEqual(GetRequestValue(Request,"editType"),"inline") then
	inlineadd = ADD_INLINE
else
	if IsEqual(GetRequestValue(Request,"editType"),"onthefly") then
		inlineadd = ADD_ONTHEFLY
		sessionPrefix = CSmartStr(strTableName) & "_add"
	else
		if IsEqual(GetRequestValue(Request,"editType"),"addmaster") then
			inlineadd = ADD_MASTER
		else
			inlineadd = ADD_SIMPLE
		end if
	end if
end if
if IsEqual(inlineadd,ADD_INLINE) then
	templatefile = "Register_inline_add.htm"
else
	templatefile = "Register_add.htm"
end if
if IsEqual(inlineadd,ADD_ONTHEFLY) then
	doAssignment id,postvalue("id")
else
	if IsEqual(inlineadd,ADD_INLINE) then
		doAssignment id,postvalue("recordID")
	else
		doAssignment id,postvalue("id")
		if IsEqual(asp_intval(id),0) then
			id = 1
		end if
	end if
end if
if not bValue(ArrayElement(Session,CSmartStr(sessionPrefix) & "_mastertable")) and bValue(postvalue("mastertable")) then
	setArrElement Session,CSmartStr(sessionPrefix) & "_mastertable",postvalue("mastertable")
end if
Set detailKeys = (CreateDictionary())
doAssignment detailKeys,GetDetailKeysByMasterTable(ArrayElement(Session,CSmartStr(sessionPrefix) & "_mastertable"),strTableName)
Set xt = (CreateClass("Xtempl",0,Empty,Empty,Empty,Empty,Empty,Empty,Empty))
xt.assign_p2 "id",id
formname = "editform" & CSmartStr(id)
doAssignment auditObj,GetAuditObject(strTableName)
Set params = (CreateDictionary3("pageType",PAGE_ADD,"id",id,"mode",inlineadd))
setArrElement params,"tName",strTableName
setArrElementByRef params,"xt",xt
setArrElement params,"includes_js",includes_js
setArrElement params,"includes_jsreq",includes_jsreq
setArrElement params,"includes_css",includes_css
setArrElement params,"locale_info",locale_info
Set pageObject = (CreateClass("RunnerPage",1,params,Empty,Empty,Empty,Empty,Empty,Empty))
isCaptchaOk = 1
if IsEqual(inlineadd,ADD_SIMPLE) or IsEqual(inlineadd,ADD_MASTER) then
end if
doAssignment onLoadJsCode,GetTableData(pageObject.tName,".jsOnloadAdd","")
pageObject.addOnLoadJsEvent_p1 onLoadJsCode
if IsEqual(inlineadd,ADD_SIMPLE) then
	doAssignment buttonHandlers,GetTableData(pageObject.tName,".buttonHandlers_" & CSmartStr(pageObject.getPageType()),CreateDictionary())
	pageObject.addButtonHandlers_p1 buttonHandlers
end if
doAssignment url_page,asp_substr(GetRequestValue(Request.ServerVariables,"SCRIPT_NAME"),CSmartDbl(asp_strrpos(GetRequestValue(Request.ServerVariables,"SCRIPT_NAME"),"/",empty))+1,12)
doAssignment isShowDetailTables,displayDetailsOn(strTableName,PAGE_ADD)
Set dpParams = (CreateDictionary())
if bValue(isShowDetailTables) and (IsEqual(inlineadd,ADD_SIMPLE) or IsEqual(inlineadd,ADD_MASTER)) then
	doAssignment ids,id
	if IsEqual(inlineadd,ADD_SIMPLE) then
		pageObject.AddJSCode_p1 ((((((((((((("window.dpObj = new dpInlineOnAddEdit({" & vbcrlf & _
			"			'mTableName':'" & CSmartStr(jsreplace(strTableName))) & "'," & vbcrlf & _
			"			'mShortTableName':'Register', " & vbcrlf & _
			"			'mForm':$('#") & CSmartStr(formname)) & "')," & vbcrlf & _
			"			'mPageType':'") & CSmartStr(PAGE_ADD)) & "'," & vbcrlf & _
			"			'mMessage':'', " & vbcrlf & _
			"			'mId':") & CSmartStr(id)) & "," & vbcrlf & _
			"			'ext':'asp'," & vbcrlf & _
			"			'dMessages':'', " & vbcrlf & _
			"			'dCaptions':[]," & vbcrlf & _
			"			'dInlineObjs':[]});" & vbcrlf & _
			"			window.dpInline") & CSmartStr(id)) & " = new detailsPreviewInline({'pageId':") & CSmartStr(id)) & ",'mode':'add_master'}); " & vbcrlf & _
			"			window.dpInline") & CSmartStr(id)) & ".createPreviewIframe();"
		pageObject.AddJSFile_p1 "detailspreview"
	end if
end if
if bValue(asp_function_exists("BeforeProcessAdd")) then
	BeforeProcessAdd conn
end if
if IsEqual(GetRequestValue(RequestForm(),"a"),"added") then
	Set afilename_values = (CreateDictionary())
	Set avalues = (CreateDictionary())
	Set blobfields = (CreateDictionary())
	Set files_move = (CreateDictionary())
	Set files_save = (CreateDictionary())
	inlineAddOption = true
	inlineAddOption = not IsEqual(inlineadd,ADD_INLINE)
	if bValue(inlineAddOption) then
		doAssignment value,postvalue("value_Name_" & CSmartStr(id))
		doAssignment var_type,postvalue("type_Name_" & CSmartStr(id))
		if bValue(FieldSubmitted("Name_" & CSmartStr(id))) then
			doAssignment value,prepare_for_db("Name",value,var_type,"","")
		else
			value = false
		end if
		if not (IsFalse(value)) then
			if (bValue(0) and "Name"="") and IsEqual(url_page,"admin_users_") then
				doAssignment value,md5(value)
			end if
			setArrElement avalues,"Name",value
		end if
	end if
	inlineAddOption = true
	inlineAddOption = not IsEqual(inlineadd,ADD_INLINE)
	if bValue(inlineAddOption) then
		doAssignment value,postvalue("value_Gender_" & CSmartStr(id))
		doAssignment var_type,postvalue("type_Gender_" & CSmartStr(id))
		if bValue(FieldSubmitted("Gender_" & CSmartStr(id))) then
			doAssignment value,prepare_for_db("Gender",value,var_type,"","")
		else
			value = false
		end if
		if not (IsFalse(value)) then
			if (bValue(0) and "Gender"="") and IsEqual(url_page,"admin_users_") then
				doAssignment value,md5(value)
			end if
			setArrElement avalues,"Gender",value
		end if
	end if
	inlineAddOption = true
	inlineAddOption = not IsEqual(inlineadd,ADD_INLINE)
	if bValue(inlineAddOption) then
		doAssignment value,postvalue("value_education_" & CSmartStr(id))
		doAssignment var_type,postvalue("type_education_" & CSmartStr(id))
		if bValue(FieldSubmitted("education_" & CSmartStr(id))) then
			doAssignment value,prepare_for_db("education",value,var_type,"","")
		else
			value = false
		end if
		if not (IsFalse(value)) then
			if (bValue(0) and "education"="") and IsEqual(url_page,"admin_users_") then
				doAssignment value,md5(value)
			end if
			setArrElement avalues,"education",value
		end if
	end if
	inlineAddOption = true
	inlineAddOption = not IsEqual(inlineadd,ADD_INLINE)
	if bValue(inlineAddOption) then
		doAssignment value,postvalue("value_Collage_" & CSmartStr(id))
		doAssignment var_type,postvalue("type_Collage_" & CSmartStr(id))
		if bValue(FieldSubmitted("Collage_" & CSmartStr(id))) then
			doAssignment value,prepare_for_db("Collage",value,var_type,"","")
		else
			value = false
		end if
		if not (IsFalse(value)) then
			if (bValue(0) and "Collage"="") and IsEqual(url_page,"admin_users_") then
				doAssignment value,md5(value)
			end if
			setArrElement avalues,"Collage",value
		end if
	end if
	inlineAddOption = true
	inlineAddOption = not IsEqual(inlineadd,ADD_INLINE)
	if bValue(inlineAddOption) then
		doAssignment value,postvalue("value_Hodid_you_hear_" & CSmartStr(id))
		doAssignment var_type,postvalue("type_Hodid_you_hear_" & CSmartStr(id))
		if bValue(FieldSubmitted("Hodid you hear_" & CSmartStr(id))) then
			doAssignment value,prepare_for_db("Hodid you hear",value,var_type,"","")
		else
			value = false
		end if
		if not (IsFalse(value)) then
			if (bValue(0) and "Hodid you hear"="") and IsEqual(url_page,"admin_users_") then
				doAssignment value,md5(value)
			end if
			setArrElement avalues,"Hodid you hear",value
		end if
	end if
	inlineAddOption = true
	inlineAddOption = not IsEqual(inlineadd,ADD_INLINE)
	if bValue(inlineAddOption) then
		doAssignment value,postvalue("value_what_do_you_think_" & CSmartStr(id))
		doAssignment var_type,postvalue("type_what_do_you_think_" & CSmartStr(id))
		if bValue(FieldSubmitted("what do you think_" & CSmartStr(id))) then
			doAssignment value,prepare_for_db("what do you think",value,var_type,"","")
		else
			value = false
		end if
		if not (IsFalse(value)) then
			if (bValue(0) and "what do you think"="") and IsEqual(url_page,"admin_users_") then
				doAssignment value,md5(value)
			end if
			setArrElement avalues,"what do you think",value
		end if
	end if
	inlineAddOption = true
	inlineAddOption = not IsEqual(inlineadd,ADD_INLINE)
	if bValue(inlineAddOption) then
		doAssignment value,postvalue("value_your_email_" & CSmartStr(id))
		doAssignment var_type,postvalue("type_your_email_" & CSmartStr(id))
		if bValue(FieldSubmitted("your email_" & CSmartStr(id))) then
			doAssignment value,prepare_for_db("your email",value,var_type,"","")
		else
			value = false
		end if
		if not (IsFalse(value)) then
			if (bValue(0) and "your email"="") and IsEqual(url_page,"admin_users_") then
				doAssignment value,md5(value)
			end if
			setArrElement avalues,"your email",value
		end if
	end if
	inlineAddOption = true
	inlineAddOption = not IsEqual(inlineadd,ADD_INLINE)
	if bValue(inlineAddOption) then
		doAssignment value,postvalue("value_Imagename_" & CSmartStr(id))
		doAssignment var_type,postvalue("type_Imagename_" & CSmartStr(id))
		if bValue(FieldSubmitted("Imagename_" & CSmartStr(id))) then
			doAssignment value,prepare_for_db("Imagename",value,var_type,"","")
		else
			value = false
		end if
		if not (IsFalse(value)) then
			if (bValue(0) and "Imagename"="") and IsEqual(url_page,"admin_users_") then
				doAssignment value,md5(value)
			end if
			setArrElement avalues,"Imagename",value
		end if
	end if
	inlineAddOption = true
	inlineAddOption = not IsEqual(inlineadd,ADD_INLINE)
	if bValue(inlineAddOption) then
		doAssignment value,postvalue("value_UploadImage_" & CSmartStr(id))
		doAssignment var_type,postvalue("type_UploadImage_" & CSmartStr(id))
		if bValue(FieldSubmitted("UploadImage_" & CSmartStr(id))) then
			doAssignment fileNameForPrepareFunc,postvalue("filename_UploadImage_" & CSmartStr(id))
			doAssignment value,prepare_upload("UploadImage","upload2",fileNameForPrepareFunc,fileNameForPrepareFunc,"",id)
		else
			value = false
		end if
		if not (IsFalse(value)) then
			if bValue(value) then
				doAssignment contents,GetUploadedFileContents("value_UploadImage_" & CSmartStr(id))
			end if
			if bValue(value) then
			end if
			if (bValue(0) and "UploadImage"="") and IsEqual(url_page,"admin_users_") then
				doAssignment value,md5(value)
			end if
			setArrElement avalues,"UploadImage",value
		end if
	end if
	failed_inline_add = false
	GetCollectionBounds afilename_values,add_loopIdx2,add_loopMax2
	do while add_loopIdx2<=add_loopMax2
		akey = GetCollectionKey(afilename_values,add_loopIdx2)
		doAssignment value,ArrayElement(afilename_values,akey)
		setArrElement avalues,akey,value
		add_loopIdx2=add_loopIdx2+1
	loop
	retval = true
	if bValue(asp_function_exists("BeforeAdd")) then
		doAssignment retval,BeforeAdd(avalues,usermessage,inlineadd)
	end if
	if bValue(retval) and IsEqual(isCaptchaOk,1) then
		if bValue(DoInsertRecord(strOriginalTableName,avalues,blobfields,id)) then
			IsSaved = true
			if bValue(auditObj) or bValue(asp_function_exists("AfterAdd")) then
				GetCollectionBounds keys,add_loopIdx3,add_loopMax3
				do while add_loopIdx3<=add_loopMax3
					idx = GetCollectionKey(keys,add_loopIdx3)
					doAssignment val,ArrayElement(keys,idx)
					setArrElement avalues,idx,val
					add_loopIdx3=add_loopIdx3+1
				loop
			end if
			if bValue(auditObj) then
				auditObj.LogAdd_p3 strTableName,avalues,keys
			end if
			if bValue(asp_function_exists("AfterAdd")) then
				AfterAdd avalues,keys,inlineadd
			end if
			if IsEqual(inlineadd,ADD_SIMPLE) or IsEqual(inlineadd,ADD_MASTER) then
				setArrElement Session,CSmartStr(strTableName) & "_count_captcha",CSmartDbl(ArrayElement(Session,CSmartStr(strTableName) & "_count_captcha"))+1
				Set permis = (CreateDictionary())
				keylink = ""
				k = 0
				GetCollectionBounds keys,add_loopIdx4,add_loopMax4
				do while add_loopIdx4<=add_loopMax4
					idx = GetCollectionKey(keys,add_loopIdx4)
					doAssignment val,ArrayElement(keys,idx)
					if not IsEqual(k,0) then
						keylink = CSmartStr(keylink) & "&"
					end if
					keylink = CSmartStr(keylink) & ((("editid" & CSmartStr(preInc(k))) & "=") & CSmartStr(htmlspecialchars(asp_rawurlencode(val))))
					add_loopIdx4=add_loopIdx4+1
				loop
				doAssignment permis,pageObject.getPermissions()
				message = CSmartStr(message) & "</br>"
				if bValue(GetTableData(strTableName,".edit",false)) and bValue(ArrayElement(permis,"edit")) then
					message = CSmartStr(message) & (("&nbsp;<a href='Register_edit.asp?" & CSmartStr(keylink)) & "'>Edit</a>&nbsp;")
				end if
				if bValue(GetTableData(strTableName,".view",false)) and bValue(ArrayElement(permis,"search")) then
					message = CSmartStr(message) & (("&nbsp;<a href='Register_view.asp?" & CSmartStr(keylink)) & "'>View</a>&nbsp;")
				end if
				mesClass = "mes_ok"
			end if
		else
			mesClass = "mes_not"
		end if
	else
		doAssignment message,usermessage
		status = "DECLINED"
		readavalues = true
	end if
end if
message = ((("<div class='message " & CSmartStr(mesClass)) & "'>") & CSmartStr(message)) & "</div>"
if (bValue(no_output_done()) and IsEqual(inlineadd,ADD_SIMPLE)) and bValue(IsSaved) then
	setArrElement Session,"message",IIF(message,message,"")
	asp_header ("Location: Register_" & CSmartStr(pageObject.getPageType())) & ".asp"
	Response.End
end if
if IsEqual(inlineadd,ADD_MASTER) and bValue(IsSaved) then
	setArrElement Session,"message",IIF(message,message,"")
end if
if IsEqual(inlineadd,ADD_SIMPLE) and not IsEmpty(ArrayElement(Session,"message")) then
	doAssignment message,ArrayElement(Session,"message")
	asp_unsetElement Session,"message"
end if
Set defvalues = (CreateDictionary())
if bValue(asp_array_key_exists("copyid1",Request)) or bValue(asp_array_key_exists("editid1",Request)) then
	Set copykeys = (CreateDictionary())
	if bValue(asp_array_key_exists("copyid1",Request)) then
		setArrElement copykeys,"RegID",postvalue("copyid1")
	else
		setArrElement copykeys,"RegID",postvalue("editid1")
	end if
	doAssignment strWhere,KeyWhere(copykeys,"")
	doAssignment strSQL,gSQLWhere(strWhere,"")
	LogInfo strSQL
	doAssignment rs,db_query(strSQL,conn)
	doAssignment defvalues,db_fetch_array(rs)
	if not bValue(defvalues) then
		Set defvalues = (CreateDictionary())
	end if
	setArrElement defvalues,"RegID",""
	if bValue(asp_function_exists("CopyOnLoad")) then
		CopyOnLoad defvalues,strWhere
	end if
else
	setArrElement defvalues,"education",0
end if
if bValue(readavalues) then
	setArrElement defvalues,"Name",ArrayElement(avalues,"Name")
	setArrElement defvalues,"Gender",ArrayElement(avalues,"Gender")
	setArrElement defvalues,"Collage",ArrayElement(avalues,"Collage")
	setArrElement defvalues,"Hodid you hear",ArrayElement(avalues,"Hodid you hear")
	setArrElement defvalues,"what do you think",ArrayElement(avalues,"what do you think")
	setArrElement defvalues,"your email",ArrayElement(avalues,"your email")
	setArrElement defvalues,"Imagename",ArrayElement(avalues,"Imagename")
	setArrElement defvalues,"education",ArrayElement(avalues,"education")
end if
includes = ""
if not IsIdentical(inlineadd,ADD_INLINE) and not IsEqual(inlineadd,ADD_ONTHEFLY) then
	pageObject.addJSCode_p1 ((("AddEventForControl('" & CSmartStr(jsreplace(strTableName))) & "', '', ") & CSmartStr(id)) & ");" & vbcrlf
end if
doAssignment onsubmit,pageObject.onSubmitForEditingPage_p1(formname)
pageObject.AddJSFile_p1 "customlabels"
if not IsEmpty(ArrayElement(params,"calendar")) then
	pageObject.AddJSFile_p1 "calendar"
end if
if not IsEqual(inlineadd,ADD_INLINE) then
	if not IsEqual(inlineadd,ADD_ONTHEFLY) then
		includes = CSmartStr(includes) & "<script language=""JavaScript"" src=""include/jquery.js""></script>" & vbcrlf
		includes = CSmartStr(includes) & "<script language=""JavaScript"" src=""include/jsfunctions.js""></script>" & vbcrlf
		if IsIdentical(pageObject.debugJSMode,true) then
			includes = CSmartStr(includes) & "<script type=""text/javascript"" src=""include/runnerJS/Runner.js""></script>"
			includes = CSmartStr(includes) & "<script type=""text/javascript"" src=""include/runnerJS/Util.js""></script>"
		else
			includes = CSmartStr(includes) & "<script type=""text/javascript"" src=""include/runnerJS/RunnerBase.js""></script>"
		end if
		pageObject.AddJSFile_p1 "ajaxsuggest"
		includes = CSmartStr(includes) & "<script language=""JavaScript"" src=""include/jsfunctions.js""></script>" & vbcrlf
		includes = CSmartStr(includes) & "<div id=""search_suggest""></div>" & vbcrlf
	end if
	xt.assign_p2 "Name_fieldblock",true
	xt.assign_p2 "Name_label",true
	if bValue(isEnableSection508()) then
		xt.assign_section_p3 "Name_label",("<label for=""" & CSmartStr(GetInputElementId("Name",id))) & """>","</label>"
	end if
	xt.assign_p2 "Gender_fieldblock",true
	xt.assign_p2 "Gender_label",true
	if bValue(isEnableSection508()) then
		xt.assign_section_p3 "Gender_label",("<label for=""" & CSmartStr(GetInputElementId("Gender",id))) & """>","</label>"
	end if
	xt.assign_p2 "Collage_fieldblock",true
	xt.assign_p2 "Collage_label",true
	if bValue(isEnableSection508()) then
		xt.assign_section_p3 "Collage_label",("<label for=""" & CSmartStr(GetInputElementId("Collage",id))) & """>","</label>"
	end if
	xt.assign_p2 "Hodid_you_hear_fieldblock",true
	xt.assign_p2 "Hodid_you_hear_label",true
	if bValue(isEnableSection508()) then
		xt.assign_section_p3 "Hodid_you_hear_label",("<label for=""" & CSmartStr(GetInputElementId("Hodid you hear",id))) & """>","</label>"
	end if
	xt.assign_p2 "what_do_you_think_fieldblock",true
	xt.assign_p2 "what_do_you_think_label",true
	if bValue(isEnableSection508()) then
		xt.assign_section_p3 "what_do_you_think_label",("<label for=""" & CSmartStr(GetInputElementId("what do you think",id))) & """>","</label>"
	end if
	xt.assign_p2 "your_email_fieldblock",true
	xt.assign_p2 "your_email_label",true
	if bValue(isEnableSection508()) then
		xt.assign_section_p3 "your_email_label",("<label for=""" & CSmartStr(GetInputElementId("your email",id))) & """>","</label>"
	end if
	xt.assign_p2 "Imagename_fieldblock",true
	xt.assign_p2 "Imagename_label",true
	if bValue(isEnableSection508()) then
		xt.assign_section_p3 "Imagename_label",("<label for=""" & CSmartStr(GetInputElementId("Imagename",id))) & """>","</label>"
	end if
	xt.assign_p2 "UploadImage_fieldblock",true
	xt.assign_p2 "UploadImage_label",true
	if bValue(isEnableSection508()) then
		xt.assign_section_p3 "UploadImage_label",("<label for=""" & CSmartStr(GetInputElementId("UploadImage",id))) & """>","</label>"
	end if
	xt.assign_p2 "education_fieldblock",true
	xt.assign_p2 "education_label",true
	if bValue(isEnableSection508()) then
		xt.assign_section_p3 "education_label",("<label for=""" & CSmartStr(GetInputElementId("education",id))) & """>","</label>"
	end if
	if not IsEqual(inlineadd,ADD_ONTHEFLY) then
		if bValue(onsubmit) then
			onsubmit = ("onsubmit=""" & CSmartStr(htmlspecialchars(onsubmit))) & """"
		end if
		setArrElement pageObject.body,"begin",CSmartStr(ArrayElement(pageObject.body,"begin")) & CSmartStr(includes)
		xt.assign_p2 "backbutton_attrs","onclick=""window.location.href='Register_list.asp?a=return'"""
		xt.assign_p2 "back_button",true
		xt.assign_p2 "addForm",CreateDictionary2("begin",((((((("<form name=""" & CSmartStr(formname)) & """ id=""") & CSmartStr(formname)) & """ encType=""multipart/form-data"" method=""post"" action=""Register_add.asp"" ") & CSmartStr(onsubmit)) & ">") & "<input type=hidden name=""a"" value=""added"">") & CSmartStr(IIF(isShowDetailTables,"<input type=hidden name=""editType"" value=""addmaster"">","")),"end","</form>")
	else
		destroyCtrls = ("Runner.controls.ControlManager.unregister('" & CSmartStr(htmlspecialchars(jsreplace(strTableName)))) & "');"
		onsubmit = ("onsubmit=""" & CSmartStr(htmlspecialchars(CSmartStr(onsubmit) & CSmartStr(destroyCtrls)))) & """"
		setArrElement pageObject.body,"begin",CSmartStr(ArrayElement(pageObject.body,"begin")) & (((((((((((((((((((((("<form name=""" & CSmartStr(formname)) & """ id=""") & CSmartStr(formname)) & """ encType=""multipart/form-data"" method=""post"" action=""Register_add.asp"" ") & CSmartStr(onsubmit)) & " target=""flyframe") & CSmartStr(id)) & """>") & "<input type=hidden name=""a"" value=""added"">") & "<input type=hidden name=""editType"" value=""onthefly"">") & "<input type=hidden name=""table"" value=""") & CSmartStr(postvalue("table"))) & """>") & "<input type=hidden name=""field"" value=""") & CSmartStr(postvalue("field"))) & """>") & "<input type=hidden name=""category"" value=""") & CSmartStr(postvalue("category"))) & """>") & "<input type=hidden name=""id"" value=""") & CSmartStr(id)) & """>")
		xt.assign_p2 "cancelbutton_attrs",((("onclick=""RemoveFlyDiv('" & CSmartStr(id)) & "');") & CSmartStr(destroyCtrls)) & """"
		xt.assign_p2 "cancel_button",true
		xt.assign_p2 "header",""
	end if
	xt.assign_p2 "save_button",true
end if
if bValue(message) then
	xt.assign_p2 "message_block",true
	xt.assign_p2 "message",message
end if
Set readonlyfields = (CreateDictionary())
linkdata = ""
if IsEqual(not bValue(inlineadd),ADD_INLINE) then
	pageObject.AddJSCode_p1 ("SetToFirstControl('" & CSmartStr(formname)) & "');"
end if
if ((IsEqual(GetRequestValue(RequestForm(),"a"),"added") and IsEqual(inlineadd,ADD_ONTHEFLY)) and not bValue(error_happened)) and not IsEqual(status,"DECLINED") then
	LookupSQL = ""
	if bValue(LookupSQL) then
		LookupSQL = CSmartStr(LookupSQL) & (" from " & CSmartStr(AddTableWrappers(strOriginalTableName)))
	end if
	data = 0
	if bValue(asp_count(keys)) and bValue(LookupSQL) then
		doAssignment where,KeyWhere(keys,"")
		LookupSQL = CSmartStr(LookupSQL) & (" where " & CSmartStr(where))
		doAssignment rs,db_query(LookupSQL,conn)
		doAssignment data,db_fetch_numarray(rs)
	end if
	if not bValue(data) then
		Set data = (CreateDictionary2(Empty,ArrayElement(avalues,linkfield),Empty,ArrayElement(avalues,dispfield)))
	end if
	ResponseWrite "<textarea id=""data"">"
	ResponseWrite "added"
	print_inline_array data,false
	ResponseWrite "</textarea>"
	Response.End
end if
if IsEqual(GetRequestValue(RequestForm(),"a"),"added") and (IsEqual(inlineadd,ADD_INLINE) or IsEqual(inlineadd,ADD_MASTER)) then
	dispFieldAlias = ""
	data = 0
	if bValue(asp_count(keys)) then
		doAssignment where,KeyWhere(keys,"")
		doAssignment sqlHead,gQuery.HeadToSql()
		doAssignment sqlGroupBy,gQuery.GroupByToSql()
		doAssignment oHaving,gQuery.Having()
		doAssignment sqlHaving,oHaving.toSql_p1(gQuery)
		doAssignment dispFieldAlias,postvalue("dispFieldAlias")
		doAssignment dispField,postvalue("dispField")
		if bValue(dispFieldAlias) then
			sqlHead = CSmartStr(sqlHead) & ((((", " & CSmartStr(dispField)) & " as ") & CSmartStr(AddFieldWrappers(dispFieldAlias))) & " ")
		end if
		doAssignment strSQL,gSQLWhere_having(sqlHead,gsqlFrom,gsqlWhereExpr,sqlGroupBy,sqlHaving,where,"")
		LogInfo strSQL
		doAssignment rs,db_query(strSQL,conn)
		doAssignment data,db_fetch_array(rs)
	end if
	if not bValue(data) then
		doAssignment data,avalues
		HaveData = false
	end if
	setArrElement showKeys,asp_count(showKeys),htmlspecialchars(ArrayElement(keys,"RegID"))
	keylink = ""
	keylink = CSmartStr(keylink) & ("&key1=" & CSmartStr(htmlspecialchars(asp_rawurlencode(ArrayElement(data,"RegID")))))
	display = false
	if IsEqual(inlineadd,ADD_MASTER) then
		display = true
	end if
	if IsEqual(inlineadd,ADD_INLINE) then
		display = true
	end if
	if bValue(display) then
		value = ""
		doAssignment value,ProcessLargeText(GetData(data,"Name",""),"field=Name" & CSmartStr(keylink),"",MODE_LIST)
		setArrElement showValues,asp_count(showValues),value
		setArrElement showFields,asp_count(showFields),"Name"
		setArrElement showRawValues,asp_count(showRawValues),asp_substr(ArrayElement(data,"Name"),0,100)
	end if
	display = false
	if IsEqual(inlineadd,ADD_MASTER) then
		display = true
	end if
	if IsEqual(inlineadd,ADD_INLINE) then
		display = true
	end if
	if bValue(display) then
		value = ""
		doAssignment value,ProcessLargeText(GetData(data,"Gender",""),"field=Gender" & CSmartStr(keylink),"",MODE_LIST)
		setArrElement showValues,asp_count(showValues),value
		setArrElement showFields,asp_count(showFields),"Gender"
		setArrElement showRawValues,asp_count(showRawValues),asp_substr(ArrayElement(data,"Gender"),0,100)
	end if
	display = false
	if IsEqual(inlineadd,ADD_MASTER) then
		display = true
	end if
	if IsEqual(inlineadd,ADD_INLINE) then
		display = true
	end if
	if bValue(display) then
		value = ""
		doAssignment value,ProcessLargeText(GetData(data,"Collage",""),"field=Collage" & CSmartStr(keylink),"",MODE_LIST)
		setArrElement showValues,asp_count(showValues),value
		setArrElement showFields,asp_count(showFields),"Collage"
		setArrElement showRawValues,asp_count(showRawValues),asp_substr(ArrayElement(data,"Collage"),0,100)
	end if
	display = false
	if IsEqual(inlineadd,ADD_MASTER) then
		display = true
	end if
	if IsEqual(inlineadd,ADD_INLINE) then
		display = true
	end if
	if bValue(display) then
		value = ""
		doAssignment value,ProcessLargeText(GetData(data,"Hodid you hear",""),"field=Hodid+you+hear" & CSmartStr(keylink),"",MODE_LIST)
		setArrElement showValues,asp_count(showValues),value
		setArrElement showFields,asp_count(showFields),"Hodid_you_hear"
		setArrElement showRawValues,asp_count(showRawValues),asp_substr(ArrayElement(data,"Hodid you hear"),0,100)
	end if
	display = false
	if IsEqual(inlineadd,ADD_MASTER) then
		display = true
	end if
	if IsEqual(inlineadd,ADD_INLINE) then
		display = true
	end if
	if bValue(display) then
		value = ""
		doAssignment value,ProcessLargeText(GetData(data,"what do you think",""),"field=what+do+you+think" & CSmartStr(keylink),"",MODE_LIST)
		setArrElement showValues,asp_count(showValues),value
		setArrElement showFields,asp_count(showFields),"what_do_you_think"
		setArrElement showRawValues,asp_count(showRawValues),asp_substr(ArrayElement(data,"what do you think"),0,100)
	end if
	display = false
	if IsEqual(inlineadd,ADD_MASTER) then
		display = true
	end if
	if IsEqual(inlineadd,ADD_INLINE) then
		display = true
	end if
	if bValue(display) then
		value = ""
		doAssignment value,ProcessLargeText(GetData(data,"your email",""),"field=your+email" & CSmartStr(keylink),"",MODE_LIST)
		setArrElement showValues,asp_count(showValues),value
		setArrElement showFields,asp_count(showFields),"your_email"
		setArrElement showRawValues,asp_count(showRawValues),asp_substr(ArrayElement(data,"your email"),0,100)
	end if
	display = false
	if IsEqual(inlineadd,ADD_MASTER) then
		display = true
	end if
	if IsEqual(inlineadd,ADD_INLINE) then
		display = true
	end if
	if bValue(display) then
		value = ""
		doAssignment value,ProcessLargeText(GetData(data,"Imagename",""),"field=Imagename" & CSmartStr(keylink),"",MODE_LIST)
		setArrElement showValues,asp_count(showValues),value
		setArrElement showFields,asp_count(showFields),"Imagename"
		setArrElement showRawValues,asp_count(showRawValues),asp_substr(ArrayElement(data,"Imagename"),0,100)
	end if
	display = false
	if IsEqual(inlineadd,ADD_MASTER) then
		display = true
	end if
	if IsEqual(inlineadd,ADD_INLINE) then
		display = true
	end if
	if bValue(display) then
		value = ""
		if bValue(CheckImageExtension(ArrayElement(data,"UploadImage"))) then
			value = "<img"
			if bValue(isEnableSection508()) then
				value = CSmartStr(value) & ((" alt=""" & CSmartStr(htmlspecialchars(ArrayElement(data,"UploadImage")))) & """")
			end if
			value = CSmartStr(value) & " width=100"
			value = CSmartStr(value) & " height=100"
			value = CSmartStr(value) & ((" id=""img_UploadImage_" & CSmartStr(id)) & """ border=0")
			value = CSmartStr(value) & ((" src=""" & CSmartStr(htmlspecialchars(AddLinkPrefix("UploadImage",ArrayElement(data,"UploadImage"),"")))) & """>")
		end if
		setArrElement showValues,asp_count(showValues),value
		setArrElement showFields,asp_count(showFields),"UploadImage"
		setArrElement showRawValues,asp_count(showRawValues),asp_substr(ArrayElement(data,"UploadImage"),0,100)
	end if
	display = false
	if IsEqual(inlineadd,ADD_MASTER) then
		display = true
	end if
	if IsEqual(inlineadd,ADD_INLINE) then
		display = true
	end if
	if bValue(display) then
		value = ""
		doAssignment value,DisplayLookupWizard("education",ArrayElement(data,"education"),data,keylink,MODE_LIST)
		setArrElement showValues,asp_count(showValues),value
		setArrElement showFields,asp_count(showFields),"education"
		setArrElement showRawValues,asp_count(showRawValues),asp_substr(ArrayElement(data,"education"),0,100)
	end if
	if bValue(dispFieldAlias) then
		setArrElement showValues,asp_count(showValues),ArrayElement(data,dispFieldAlias)
		setArrElement showFields,asp_count(showFields),dispFieldAlias
		setArrElement showRawValues,asp_count(showRawValues),asp_substr(ArrayElement(data,dispFieldAlias),0,100)
	end if
	if IsEqual(inlineadd,ADD_INLINE) then
		ResponseWrite "<textarea id=""data"">"
		if bValue(IsSaved) and bValue(asp_count(showValues)) then
			if bValue(HaveData) then
				ResponseWrite "saved"
			else
				ResponseWrite "savnd"
			end if
			print_inline_array showKeys,false
			ResponseWrite vblf
			print_inline_array showValues,false
			ResponseWrite vblf
			print_inline_array showFields,false
			ResponseWrite vblf
			print_inline_array showRawValues,false
			ResponseWrite vblf
			print_inline_array showDetailKeys,true
			ResponseWrite vblf
			print_inline_array showDetailKeys,false
			ResponseWrite vblf
			ResponseWrite asp_str_replace(CreateDictionary5(Empty,"&",Empty,"<",Empty,"\",Empty,vbcr,Empty,vblf),CreateDictionary5(Empty,"&amp;",Empty,"&lt;",Empty,"\\",Empty,"\r",Empty,"\n"),usermessage)
		else
			if IsEqual(status,"DECLINED") then
				ResponseWrite "decli"
			else
				ResponseWrite "error"
			end if
			ResponseWrite asp_str_replace(CreateDictionary5(Empty,"&",Empty,"<",Empty,"\",Empty,vbcr,Empty,vblf),CreateDictionary5(Empty,"&amp;",Empty,"&lt;",Empty,"\\",Empty,"\r",Empty,"\n"),message)
		end if
		ResponseWrite "</textarea>"
		Response.End
	end if
end if
if IsEqual(inlineadd,ADD_MASTER) then
	ResponseWrite "<textarea id=""data"">"
	code = ""
	if IsEqual(GetRequestValue(RequestForm(),"a"),"added") and bValue(IsSaved) then
		code = CSmartStr(code) & "window.dpObj.Opts.mSavedValues = {"
		i = 0
		do while IsLess(i,asp_count(showFields))
			code = CSmartStr(code) & (((((("'" & CSmartStr(jsreplace(ArrayElement(showFields,i)))) & "':'") & CSmartStr(jsreplace(ArrayElement(showValues,i)))) & "'") & CSmartStr(IIF(not IsEqual(i,CSmartDbl(asp_count(showFields))-1),",",""))) & " ")
			i = CSmartDbl(i)+1
		loop
		code = CSmartStr(code) & "};"
		i = 0
		do while IsLess(i,asp_count(ArrayElement(dpParams,"ids")))
			data = 0
			if bValue(asp_count(keys)) then
				doAssignment where,KeyWhere(keys,"")
				doAssignment strSQL,gSQLWhere(where,"")
				LogInfo strSQL
				doAssignment rs,db_query(strSQL,conn)
				doAssignment data,db_fetch_array(rs)
			end if
			if not bValue(data) then
				doAssignment data,avalues
			end if
			code = CSmartStr(code) & (("var obj = window.inlineEditing" & CSmartStr(ArrayElement(ArrayElement(dpParams,"ids"),i))) & ";" & vbcrlf & _
				"					  if(obj && obj.isSbmSuc){obj.mKeys = [")
			GetCollectionBounds ArrayElement(mKeys,ArrayElement(ArrayElement(dpParams,"strTableNames"),i)),add_loopIdx8,add_loopMax8
			do while add_loopIdx8<=add_loopMax8
				add_arrKey8 = GetCollectionKey(ArrayElement(mKeys,ArrayElement(ArrayElement(dpParams,"strTableNames"),i)),add_loopIdx8)
				doAssignment mk,ArrayElement(ArrayElement(mKeys,ArrayElement(ArrayElement(dpParams,"strTableNames"),i)),add_arrKey8)
				code = CSmartStr(code) & (("'" & CSmartStr(jsreplace(ArrayElement(data,mk)))) & "',")
				add_loopIdx8=add_loopIdx8+1
			loop
			doAssignment code,asp_substr(code,0,-1)
			code = CSmartStr(code) & "];}"
			i = CSmartDbl(i)+1
		loop
		if (not IsEmpty(ArrayElement(Session,CSmartStr(strTableName) & "_count_captcha")) or IsLess(0,ArrayElement(Session,CSmartStr(strTableName) & "_count_captcha"))) or IsLess(ArrayElement(Session,CSmartStr(strTableName) & "_count_captcha"),5) then
			code = CSmartStr(code) & "window.dpObj.hideCaptcha();"
		end if
		code = CSmartStr(code) & "window.dpObj.saveAllDetail();"
	else
		if IsIdentical(GetRequestValue(Request,"isSbmSuc"),"0") then
			code = CSmartStr(code) & "window.dpObj.saveAllDetail();"
		else
			if not bValue(isCaptchaOk) then
				code = CSmartStr(code) & "window.dpObj.showHideInvalidCaptcha('show');"
			else
				code = CSmartStr(code) & (("window.dpObj.Opts.mMessage =""" & CSmartStr(message)) & """;" & vbcrlf & _
					"				  window.dpObj.showMessage();" & vbcrlf & _
					"				  window.dpObj.showHideInvalidCaptcha('hide');")
			end if
		end if
	end if
	ResponseWrite CSmartStr(code) & "</textarea>"
	Response.End
end if
regex = ""
regexmessage = ""
regextype = ""
Set control_Name = (CreateDictionary())
setArrElement control_Name,"func","xt_buildeditcontrol"
setArrElement control_Name,"params",CreateDictionary()
setArrElementN control_Name,CreateArray2("params","field"),"Name"
setArrElementN control_Name,CreateArray2("params","value"),ArrayElement(defvalues,"Name")
Set arrValidate = (CreateDictionary())
setArrElementN control_Name,CreateArray2("params","validate"),arrValidate
setArrElementN control_Name,CreateArray2("params","id"),id
if IsEqual(inlineadd,ADD_INLINE) or IsEqual(inlineadd,ADD_ONTHEFLY) then
	setArrElementN control_Name,CreateArray2("params","mode"),"inline_add"
else
	setArrElementN control_Name,CreateArray2("params","mode"),"add"
end if
if not bValue(detailKeys) or not bValue(asp_in_array("Name",detailKeys,false)) then
	xt.assignbyref_p2 "Name_editcontrol",control_Name
else
	if bValue(asp_array_key_exists("Name",defvalues)) then
		doAssignment value,ProcessLargeText(GetData(defvalues,"Name",""),"field=Name","",MODE_VIEW)
		xt.assignbyref_p2 "Name_editcontrol",value
	end if
end if
Set control_Gender = (CreateDictionary())
setArrElement control_Gender,"func","xt_buildeditcontrol"
setArrElement control_Gender,"params",CreateDictionary()
setArrElementN control_Gender,CreateArray2("params","field"),"Gender"
setArrElementN control_Gender,CreateArray2("params","value"),ArrayElement(defvalues,"Gender")
Set arrValidate = (CreateDictionary())
setArrElementN control_Gender,CreateArray2("params","validate"),arrValidate
setArrElementN control_Gender,CreateArray2("params","id"),id
if IsEqual(inlineadd,ADD_INLINE) or IsEqual(inlineadd,ADD_ONTHEFLY) then
	setArrElementN control_Gender,CreateArray2("params","mode"),"inline_add"
else
	setArrElementN control_Gender,CreateArray2("params","mode"),"add"
end if
if not bValue(detailKeys) or not bValue(asp_in_array("Gender",detailKeys,false)) then
	xt.assignbyref_p2 "Gender_editcontrol",control_Gender
else
	if bValue(asp_array_key_exists("Gender",defvalues)) then
		doAssignment value,ProcessLargeText(GetData(defvalues,"Gender",""),"field=Gender","",MODE_VIEW)
		xt.assignbyref_p2 "Gender_editcontrol",value
	end if
end if
Set control_Collage = (CreateDictionary())
setArrElement control_Collage,"func","xt_buildeditcontrol"
setArrElement control_Collage,"params",CreateDictionary()
setArrElementN control_Collage,CreateArray2("params","field"),"Collage"
setArrElementN control_Collage,CreateArray2("params","value"),ArrayElement(defvalues,"Collage")
Set arrValidate = (CreateDictionary())
setArrElementN control_Collage,CreateArray2("params","validate"),arrValidate
setArrElementN control_Collage,CreateArray2("params","id"),id
if IsEqual(inlineadd,ADD_INLINE) or IsEqual(inlineadd,ADD_ONTHEFLY) then
	setArrElementN control_Collage,CreateArray2("params","mode"),"inline_add"
else
	setArrElementN control_Collage,CreateArray2("params","mode"),"add"
end if
if not bValue(detailKeys) or not bValue(asp_in_array("Collage",detailKeys,false)) then
	xt.assignbyref_p2 "Collage_editcontrol",control_Collage
else
	if bValue(asp_array_key_exists("Collage",defvalues)) then
		doAssignment value,ProcessLargeText(GetData(defvalues,"Collage",""),"field=Collage","",MODE_VIEW)
		xt.assignbyref_p2 "Collage_editcontrol",value
	end if
end if
Set control_Hodid_you_hear = (CreateDictionary())
setArrElement control_Hodid_you_hear,"func","xt_buildeditcontrol"
setArrElement control_Hodid_you_hear,"params",CreateDictionary()
setArrElementN control_Hodid_you_hear,CreateArray2("params","field"),"Hodid you hear"
setArrElementN control_Hodid_you_hear,CreateArray2("params","value"),ArrayElement(defvalues,"Hodid you hear")
Set arrValidate = (CreateDictionary())
setArrElementN control_Hodid_you_hear,CreateArray2("params","validate"),arrValidate
setArrElementN control_Hodid_you_hear,CreateArray2("params","id"),id
if IsEqual(inlineadd,ADD_INLINE) or IsEqual(inlineadd,ADD_ONTHEFLY) then
	setArrElementN control_Hodid_you_hear,CreateArray2("params","mode"),"inline_add"
else
	setArrElementN control_Hodid_you_hear,CreateArray2("params","mode"),"add"
end if
if not bValue(detailKeys) or not bValue(asp_in_array("Hodid_you_hear",detailKeys,false)) then
	xt.assignbyref_p2 "Hodid_you_hear_editcontrol",control_Hodid_you_hear
else
	if bValue(asp_array_key_exists("Hodid_you_hear",defvalues)) then
		doAssignment value,ProcessLargeText(GetData(defvalues,"Hodid you hear",""),"field=Hodid+you+hear","",MODE_VIEW)
		xt.assignbyref_p2 "Hodid_you_hear_editcontrol",value
	end if
end if
Set control_what_do_you_think = (CreateDictionary())
setArrElement control_what_do_you_think,"func","xt_buildeditcontrol"
setArrElement control_what_do_you_think,"params",CreateDictionary()
setArrElementN control_what_do_you_think,CreateArray2("params","field"),"what do you think"
setArrElementN control_what_do_you_think,CreateArray2("params","value"),ArrayElement(defvalues,"what do you think")
Set arrValidate = (CreateDictionary())
setArrElementN control_what_do_you_think,CreateArray2("params","validate"),arrValidate
setArrElementN control_what_do_you_think,CreateArray2("params","id"),id
if IsEqual(inlineadd,ADD_INLINE) or IsEqual(inlineadd,ADD_ONTHEFLY) then
	setArrElementN control_what_do_you_think,CreateArray2("params","mode"),"inline_add"
else
	setArrElementN control_what_do_you_think,CreateArray2("params","mode"),"add"
end if
if not bValue(detailKeys) or not bValue(asp_in_array("what_do_you_think",detailKeys,false)) then
	xt.assignbyref_p2 "what_do_you_think_editcontrol",control_what_do_you_think
else
	if bValue(asp_array_key_exists("what_do_you_think",defvalues)) then
		doAssignment value,ProcessLargeText(GetData(defvalues,"what do you think",""),"field=what+do+you+think","",MODE_VIEW)
		xt.assignbyref_p2 "what_do_you_think_editcontrol",value
	end if
end if
Set control_your_email = (CreateDictionary())
setArrElement control_your_email,"func","xt_buildeditcontrol"
setArrElement control_your_email,"params",CreateDictionary()
setArrElementN control_your_email,CreateArray2("params","field"),"your email"
setArrElementN control_your_email,CreateArray2("params","value"),ArrayElement(defvalues,"your email")
Set arrValidate = (CreateDictionary())
doAssignment validatetype,getJsValidatorName("Email")
setArrElementN arrValidate,CreateArray2("basicValidate",empty),validatetype
setArrElementN control_your_email,CreateArray2("params","validate"),arrValidate
setArrElementN control_your_email,CreateArray2("params","id"),id
if IsEqual(inlineadd,ADD_INLINE) or IsEqual(inlineadd,ADD_ONTHEFLY) then
	setArrElementN control_your_email,CreateArray2("params","mode"),"inline_add"
else
	setArrElementN control_your_email,CreateArray2("params","mode"),"add"
end if
if not bValue(detailKeys) or not bValue(asp_in_array("your_email",detailKeys,false)) then
	xt.assignbyref_p2 "your_email_editcontrol",control_your_email
else
	if bValue(asp_array_key_exists("your_email",defvalues)) then
		doAssignment value,ProcessLargeText(GetData(defvalues,"your email",""),"field=your+email","",MODE_VIEW)
		xt.assignbyref_p2 "your_email_editcontrol",value
	end if
end if
Set control_Imagename = (CreateDictionary())
setArrElement control_Imagename,"func","xt_buildeditcontrol"
setArrElement control_Imagename,"params",CreateDictionary()
setArrElementN control_Imagename,CreateArray2("params","field"),"Imagename"
setArrElementN control_Imagename,CreateArray2("params","value"),ArrayElement(defvalues,"Imagename")
Set arrValidate = (CreateDictionary())
setArrElementN control_Imagename,CreateArray2("params","validate"),arrValidate
setArrElementN control_Imagename,CreateArray2("params","id"),id
if IsEqual(inlineadd,ADD_INLINE) or IsEqual(inlineadd,ADD_ONTHEFLY) then
	setArrElementN control_Imagename,CreateArray2("params","mode"),"inline_add"
else
	setArrElementN control_Imagename,CreateArray2("params","mode"),"add"
end if
if not bValue(detailKeys) or not bValue(asp_in_array("Imagename",detailKeys,false)) then
	xt.assignbyref_p2 "Imagename_editcontrol",control_Imagename
else
	if bValue(asp_array_key_exists("Imagename",defvalues)) then
		doAssignment value,ProcessLargeText(GetData(defvalues,"Imagename",""),"field=Imagename","",MODE_VIEW)
		xt.assignbyref_p2 "Imagename_editcontrol",value
	end if
end if
Set control_UploadImage = (CreateDictionary())
setArrElement control_UploadImage,"func","xt_buildeditcontrol"
setArrElement control_UploadImage,"params",CreateDictionary()
setArrElementN control_UploadImage,CreateArray2("params","field"),"UploadImage"
setArrElementN control_UploadImage,CreateArray2("params","value"),ArrayElement(defvalues,"UploadImage")
Set arrValidate = (CreateDictionary())
setArrElementN control_UploadImage,CreateArray2("params","validate"),arrValidate
setArrElementN control_UploadImage,CreateArray2("params","id"),id
if IsEqual(inlineadd,ADD_INLINE) or IsEqual(inlineadd,ADD_ONTHEFLY) then
	setArrElementN control_UploadImage,CreateArray2("params","mode"),"inline_add"
else
	setArrElementN control_UploadImage,CreateArray2("params","mode"),"add"
end if
if not bValue(detailKeys) or not bValue(asp_in_array("UploadImage",detailKeys,false)) then
	xt.assignbyref_p2 "UploadImage_editcontrol",control_UploadImage
else
	if bValue(asp_array_key_exists("UploadImage",defvalues)) then
		doAssignment value,GetData(defvalues,"UploadImage","File-based Image")
		xt.assignbyref_p2 "UploadImage_editcontrol",value
	end if
end if
Set control_education = (CreateDictionary())
setArrElement control_education,"func","xt_buildeditcontrol"
setArrElement control_education,"params",CreateDictionary()
setArrElementN control_education,CreateArray2("params","field"),"education"
setArrElementN control_education,CreateArray2("params","value"),ArrayElement(defvalues,"education")
Set arrValidate = (CreateDictionary())
setArrElementN control_education,CreateArray2("params","validate"),arrValidate
setArrElementN control_education,CreateArray2("params","id"),id
if IsEqual(inlineadd,ADD_INLINE) or IsEqual(inlineadd,ADD_ONTHEFLY) then
	setArrElementN control_education,CreateArray2("params","mode"),"inline_add"
else
	setArrElementN control_education,CreateArray2("params","mode"),"add"
end if
if not bValue(detailKeys) or not bValue(asp_in_array("education",detailKeys,false)) then
	xt.assignbyref_p2 "education_editcontrol",control_education
else
	if bValue(asp_array_key_exists("education",defvalues)) then
		doAssignment value,DisplayLookupWizard("education",ArrayElement(defvalues,"education"),defvalues,"",MODE_VIEW)
		xt.assignbyref_p2 "education_editcontrol",value
	end if
end if
pageObject.addCommonJs 
if bValue(isShowDetailTables) then
	Set options = (CreateDictionary())
	setArrElement options,"mode",LIST_DETAILS
	setArrElement options,"pageType",PAGE_LIST
	setArrElement options,"masterPageType",PAGE_ADD
	setArrElement options,"masterTable",strTableName
	setArrElement options,"firstTime",1
	Set detailTables = (CreateDictionary())
	d = 0
	do while IsLess(d,asp_count(ArrayElement(dpParams,"ids")))
		doAssignment strTableName,ArrayElement(ArrayElement(dpParams,"strTableNames"),d)
		asp_include ("include/" & CSmartStr(GetTableURL(strTableName))) & "_settings.asp",false
		if not bValue(d) then
			asp_include "classes/listpage.asp",false
			asp_include "classes/listpage_embed.asp",false
			asp_include "classes/listpage_dpinline.asp",false
			asp_include "classes/searchclause.asp",false
		end if
		setArrElement options,"xt",CreateClass("Xtempl",0,Empty,Empty,Empty,Empty,Empty,Empty,Empty)
		setArrElement options,"id",ArrayElement(ArrayElement(dpParams,"ids"),d)
		doAssignment listPageObject,method_ListPage_createListPage(this_object,strTableName,options)
		listPageObject.prepareForBuildPage 
		if bValue(listPageObject.isDispGrid()) then
			Set listJsFiles = (CreateDictionary())
			Set listCssFiles = (CreateDictionary())
			pageObject.AddJSCode_p1 (((((vblf & _
				" /*---Begin code for detailsPreview_" & CSmartStr(ArrayElement(options,"id"))) & "---*/ " & vblf) & CSmartStr(listPageObject.grabAllJsCode())) & vblf & _
				" /*---End code for detailsPreview_") & CSmartStr(ArrayElement(options,"id"))) & "---*/ " & vblf
			doAssignment listJsFiles,listPageObject.grabAllJSFiles()
			i = 0
			do while IsLess(i,asp_count(listJsFiles))
				pageObject.AddJSFile_p1 ArrayElement(listJsFiles,i)
				i = CSmartDbl(i)+1
			loop
			doAssignment listCssFiles,listPageObject.grabAllCSSFiles()
			i = 0
			do while IsLess(i,asp_count(listCssFiles))
				pageObject.AddCSSFile_p1 ArrayElement(listCssFiles,i)
				i = CSmartDbl(i)+1
			loop
		end if
		setArrElement detailTables,asp_count(detailTables),CreateDictionary1("displayDetailTable_" & CSmartStr(GoodFieldName(strTableName)),CreateDictionary2("func","showDetailTable","params",CreateDictionary2("dpObject",listPageObject,"dpParams",strTableName)))
		d = CSmartDbl(d)+1
	loop
	xt.assign_loopsection_p2 "detail_tables",detailTables
	strTableName = "dbo.Register"
end if
doAssignment jscode,pageObject.PrepareJS()
if not IsEqual(inlineadd,ADD_ONTHEFLY) and not IsEqual(inlineadd,ADD_MASTER) then
	if IsEqual(inlineadd,ADD_INLINE) then
		doAssignment jscode,asp_str_replace(CreateDictionary3(Empty,"&",Empty,"<",Empty,">"),CreateDictionary3(Empty,"&amp;",Empty,"&lt;",Empty,"&gt;"),jscode)
		xt.assignbyref_p2 "linkdata",jscode
	end if
	setArrElement pageObject.body,"end",CSmartStr(ArrayElement(pageObject.body,"end")) & (("<script>" & CSmartStr(jscode)) & "</script>")
	xt.assign_p2 "body",pageObject.body
	xt.assign_p2 "flybody",true
else
	if not bValue(GetRequestValue(RequestForm(),"a"))=bValue("added") then
		ResponseWrite "<jscode>"
		ResponseWrite asp_str_replace(CreateDictionary3(Empty,"\",Empty,vbcr,Empty,vblf),CreateDictionary3(Empty,"\\",Empty,"\r",Empty,"\n"),jscode)
		ResponseWrite "</jscode>"
	else
		if IsEqual(GetRequestValue(RequestForm(),"a"),"added") and (bValue(error_happened) or IsEqual(status,"DECLINED")) then
			ResponseWrite "<textarea id=""data"">decli"
			ResponseWrite htmlspecialchars(jscode)
			ResponseWrite "</textarea>"
		end if
	end if
	setArrElement pageObject.body,"end",CSmartStr(ArrayElement(pageObject.body,"end")) & "</form>"
	xt.assign_p2 "footer",""
	xt.assign_p2 "flybody",pageObject.body
	xt.assign_p2 "body",true
end if
xt.assign_p2 "style_block",true
pageObject.xt.assign_p2 "legendBreak","<br/>"
if bValue(asp_function_exists("BeforeShowAdd")) then
	BeforeShowAdd xt,templatefile
end if
if IsEqual(inlineadd,ADD_ONTHEFLY) then
	xt.load_template_p1 templatefile
	if IsEqual(GetRequestValue(RequestForm(),"a"),"added") and (bValue(error_happened) or IsEqual(status,"DECLINED")) then
		ResponseWrite "<textarea id=""html"">"
		xt.display_loaded_p1 "style_block"
		xt.display_loaded_p1 "flybody"
		ResponseWrite "</textarea>"
	else
		xt.display_loaded_p1 "style_block"
		xt.display_loaded_p1 "flybody"
	end if
else
	xt.display_p1 templatefile
end if
%>

.....And here is the dbcommon file include....

<%@codepage=1252%>
<%

cCharset = "Windows-1252"

response.Charset=cCharset

useAJAX=true
suggestAllContent=true
gLoadSearchControls = 10

SQLUpdateMode=false

Session.LCID = 1033
session.codepage=1252


nDatabaseType = 2


dim dbConnection

set arrAvailableEvents = CreateDictionary()
dim conn


%>
<!--#include file="locale.asp"-->
<!--#include file="events.asp"-->
<!--#include file="commonfunctions.asp"-->
<!--#include file="dbconnection.asp"-->
<!--#include file="aspfunctions.asp"-->
<!--#include file="dal.asp"-->
<!--#include file="appsettings.asp"-->
<%


Set myRequest = CreateObject("Scripting.Dictionary")
Set myRequestFiles = CreateObject("Scripting.Dictionary")
formParsed=0


function db_connect()
	set dbConnection = server.CreateObject("ADODB.Connection")
   	dbConnection.ConnectionString = strConnection
   	dbConnection.Open
    set db_connect=dbConnection	
end function
function AddTableWrappers(strName)
	if mid(strName,1,1)=strLeftWrapper then
		AddTableWrappers = strName
		exit function
	end if
	dim arr
	arr=split(strName,".")
	ret=strLeftWrapper & arr(0) & strRightWrapper
	if ubound(arr)>0 then ret=ret & "." & strLeftWrapper & arr(1) & strRightWrapper
	AddTableWrappers = ret
end function

function db_upper(dbval)
	db_upper = "upper(" & dbval & ")"
end function

function AddFieldWrappers(strName)
	if mid(strName,1,1)=strLeftWrapper then
		AddFieldWrappers = strName
	else
		AddFieldWrappers = strLeftWrapper & strName & strRightWrapper
	end if
end function
function FieldNeedQuotes(rs,field)
	ttype=db_fieldtype(rs,field)
	if ttype=20 or ttype=128 or ttype=11 or ttype=6 or ttype=14 or ttype=5 or ttype=3 or ttype=131 _
	or ttype=4	or ttype=2	or ttype=16 or ttype=21 or ttype=19 or ttype=18 or ttype=17 or ttype=139 then
		FieldNeedQuotes = false
	else
		FieldNeedQuotes = true
	end if
end function

function db_addslashes(str)
	db_addslashes = asp_str_replace("'","''",str)
end function
function db_datequotes(val)
	db_datequotes = "convert(datetime,'" & val & "',120)"
end function

function db_stripslashesbinary(str)
	if isnull(str) or isempty(str) then
		db_stripslashesbinary=str
		exit function
	end if
	db_stripslashesbinary=str
end function

function db_fieldtype(lhandle,fname)
	Dim i
	for i=0 to db_numfields(lhandle)-1
		if db_fieldname(lhandle,i)=fname then
			ttype=db_fieldtypen(lhandle,i)
			db_fieldtype = ttype
			exit function
		end if
	next
	db_fieldtype = ""
end function
function db_numfields(lhandle)
	db_numfields = lhandle.Fields.Count
end function

function db_fieldname(lhandle,fnumber)
	db_fieldname = lhandle.Fields(fnumber).Name
end function

function db_fieldtypen(lhandle,fnumber)
	db_fieldtypen = lhandle.Fields(fnumber).Type
end function

function date2str(val)
	if isnull(val) then
		date2str=""
		exit function
	end if
	if isdate(val) then
		date2str = CStr(year(val)) & "-" & CStr(month(val)) & "-" & CStr(day(val)) & _
				" " & CStr(hour(val)) & ":" & CStr(minute(val)) & ":" & CStr(second(val))
		exit function
	end if
	date2str=""
end function



%>

Huf !! :o ... well I could not find 'OnPageLoadAdd' method in your last code.

This is how the page looks as from View Source.... This was generated using the ASPRunner 6.2

<html lang="en">
<head><title>Register</title>
<link REL="stylesheet" href="include/style.css" type="text/css">
<!--[if IE]>
<link REL="stylesheet" href="include/styleIE.css" type="text/css">
<![endif]-->

<style>
#center_block1 {width:500px;margin:0 auto;}
#contents_block1 {text-align:center;}
#header_block1 {white-space:nowrap;height:31px;padding-top:5px;text-align:center;}
#fields_block1 {width:100%}
#buttons_block1 {padding-bottom:5px;white-space:nowrap;text-align:center;}
#required_block1 {text-align:left;padding:5px}
</style>

</head>
<body>

			<script type="text/javascript">
				window.debugMode = false;
			</script><script language="JavaScript" src="include/jquery.js"></script>
<script language="JavaScript" src="include/jsfunctions.js"></script>

<script type="text/javascript" src="include/runnerJS/RunnerBase.js"></script><script language="JavaScript" src="include/jsfunctions.js"></script>
<div id="search_suggest"></div>


<form name="editform1" id="editform1" encType="multipart/form-data" method="post" action="Register_add.asp" onsubmit="$(&#039;#message_block1&#039;).html(&#039;&#039;);var valRes = checkValidSimplePage(&#039;editform1&#039;,&#039;dbo.Register&#039;); return valRes;"><input type=hidden name="a" value="added">
<TABLE class="main_table2" align="center" id="center_block1" cellpadding=0 cellspacing=0><tr><td id="contents_block1">

<div>
<div id="header_block1" class="upeditmenu" >
Register, Add new record
</div>


<div id="message_block1" class="downedit"><div class='message '></div></div>


<table cellpadding=4 cellspacing=0 border=0 id="fields_block1">

  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	Name
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_Name_0" style="white-space: nowrap;"><input id="value_Name_1" style="" type="text" name="value_Name_1"  maxlength=250 value=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newTextField1 = new Runner.controls.TextField({
		fieldName: 'Name', 
		goodFieldName: 'Name',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script></span>
  </td></tr>

  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	Gender
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_Gender_0" style="white-space: nowrap;"><input id="value_Gender_1" style="" type="text" name="value_Gender_1"  maxlength=250 value=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newTextField1 = new Runner.controls.TextField({
		fieldName: 'Gender', 
		goodFieldName: 'Gender',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script></span>
  </td></tr>


  <tr><td class=editshade_b width=150 style="padding-left:15px;">

	Education
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_education_0" style=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newDropDownLookup1 = new Runner.controls.DropDownLookup({
		fieldName: 'education', 
		goodFieldName: 'education',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script><select size = "1" id="value_education_1" name="value_education_1"><option value="">Please select</option><option value="1">Sector 1</option><option value="2">Sector 2</option><option value="3">Sector 3</option><option value="4">Sector 4</option><option value="5">Sector 5:</option><option value="6">Sector 6:</option><option value="7">Sector 7:</option><option value="8">Sector 8:</option><option value="9">Sector 9:</option><option value="10">(N/A) admin Role</option><option value="11">tyftyfytf</option></select></span>

  </td></tr>


  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	Collage
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_Collage_0" style=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newCheckBoxLookup1 = new Runner.controls.CheckBoxLookup({
		fieldName: 'Collage', 
		goodFieldName: 'Collage',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register', multiSel: 2}); 
			}, 1);
		 </script><input id="type_Collage_1" type=hidden name="type_Collage_1" value="multiselect"><div align='left'><input id="value_Collage_1" type="checkbox"  name="value_Collage_1[]" value="test"/>&nbsp;<b id="data_value_Collage_1_0">test</b><br/><input id="value_Collage_1" type="checkbox"  name="value_Collage_1[]" value="tree"/>&nbsp;<b id="data_value_Collage_1_1">tree</b><br/><input id="value_Collage_1" type="checkbox"  name="value_Collage_1[]" value="sdvcvcv"/>&nbsp;<b id="data_value_Collage_1_2">sdvcvcv</b><br/><input id="value_Collage_1" type="checkbox"  name="value_Collage_1[]" value="jhghf"/>&nbsp;<b id="data_value_Collage_1_3">jhghf</b><br/></div></span>

  </td></tr>


  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	Hodid you hear
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_Hodid_you_hear_0" style="white-space: nowrap;"><input id="value_Hodid_you_hear_1" style="" type="text" name="value_Hodid_you_hear_1"  maxlength=250 value=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newTextField1 = new Runner.controls.TextField({
		fieldName: 'Hodid you hear', 
		goodFieldName: 'Hodid_you_hear',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script></span>
  </td></tr>

  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	what do you think
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_what_do_you_think_0" style="white-space: nowrap;"><input id="value_what_do_you_think_1" style="" type="text" name="value_what_do_you_think_1"  maxlength=250 value=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newTextField1 = new Runner.controls.TextField({
		fieldName: 'what do you think', 
		goodFieldName: 'what_do_you_think',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script></span>
  </td></tr>


  <tr><td class=editshade_b width=150 style="padding-left:15px;">

	Your Email
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_your_email_0" style="white-space: nowrap;"><input id="value_your_email_1" style="" type="text" name="value_your_email_1"  maxlength=250 value=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newTextField1 = new Runner.controls.TextField({
		fieldName: 'your email', 
		goodFieldName: 'your_email',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,validationArr: ['IsEmail'],mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script></span>
  </td></tr>


  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	Imagename
  </td>

  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_Imagename_0" style="white-space: nowrap;"><input id="value_Imagename_1" style="" type="text" name="value_Imagename_1"  maxlength=250 value=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newTextField1 = new Runner.controls.TextField({
		fieldName: 'Imagename', 
		goodFieldName: 'Imagename',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script></span>
  </td></tr>


  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	Upload Image
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_UploadImage_0" style=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newFileField1 = new Runner.controls.FileField({
		fieldName: 'UploadImage', 
		goodFieldName: 'UploadImage',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register', addTimeStamp: 'true'}); 
			}, 1);
		 </script><input id="type_UploadImage_1" type="hidden" name="type_UploadImage_1" value="upload2"><input type="File" id="value_UploadImage_1"  name="value_UploadImage_1" ><br>Filename&nbsp;&nbsp;<input type="text" id="filename_UploadImage_1" name="filename_UploadImage_1" size="50" maxlength="100"></span>

  </td></tr>

</table>

<div class="toplist" id="buttons_block1">
	
	<br/>
	
	<span class=buttonborder><input class=button type=submit value="Save" name=submit1 ></span>
	
	
	
	<span class=buttonborder><input class=button type=button value="Back to list" onclick="window.location.href='Register_list.asp?a=return'"></span>
	
</div>
</div>

</td></tr>

</table>
</form>

<br><br>

<script>Runner.util.ScriptLoader.addPostLoadStep(function()
			{				
				setButtonBorderStyle();
				window.TEXT_MONTH_JAN='January';
window.TEXT_MONTH_FEB='February';
window.TEXT_MONTH_MAR='March';
window.TEXT_MONTH_APR='April';
window.TEXT_MONTH_MAY='May';
window.TEXT_MONTH_JUN='June';
window.TEXT_MONTH_JUL='July';
window.TEXT_MONTH_AUG='August';
window.TEXT_MONTH_SEP='September';
window.TEXT_MONTH_OCT='October';
window.TEXT_MONTH_NOV='November';
window.TEXT_MONTH_DEC='December';
window.TEXT_DAY_SU='Su';
window.TEXT_DAY_MO='Mo';
window.TEXT_DAY_TU='Tu';
window.TEXT_DAY_WE='We';
window.TEXT_DAY_TH='Th';
window.TEXT_DAY_FR='Fr';
window.TEXT_DAY_SA='Sa';
window.TEXT_TODAY='today';
window.TEXT_SELECT_DATE = 'Select Date';
window.TEXT_INVALID_CAPTCHA_CODE='Invalid security code.';

window['tName1'] = 'dbo.Register';
window.TEXT_INLINE_FIELD_REQUIRED='Required field';
window.TEXT_INLINE_FIELD_ZIPCODE='Field should be a valid zipcode';
window.TEXT_INLINE_FIELD_EMAIL='Field should be a valid email address';
window.TEXT_INLINE_FIELD_NUMBER='Field should be a valid number';
window.TEXT_INLINE_FIELD_CURRENCY='Field should be a valid currency';
window.TEXT_INLINE_FIELD_PHONE='Field should be a valid phone number';
window.TEXT_INLINE_FIELD_PASSWORD1='Field can not be \'password\'';
window.TEXT_INLINE_FIELD_PASSWORD2='Field should be at least 4 characters long';
window.TEXT_INLINE_FIELD_STATE='Field should be a valid US state name';
window.TEXT_INLINE_FIELD_SSN='Field should be a valid Social Security Number';
window.TEXT_INLINE_FIELD_DATE='Field should be a valid date';
window.TEXT_INLINE_FIELD_TIME='Field should be a valid time in 24-hour format';
window.TEXT_INLINE_FIELD_CC='Field should be a valid credit card number';
window.TEXT_INLINE_FIELD_SSN='Field should be a valid Social Security Number';

window.TEXT_PLEASE_SELECT='Please select';
window.current_language='English';

window.locale_dateformat = '1';
window.locale_datedelimiter = '-';
window.bLoading=false;

window.TEXT_CTRL_CLICK = "CTRL + click for multiple sorting";
window.TEXT_SAVE='Save';
window.TEXT_CANCEL='Cancel';
window.TEXT_INLINE_ERROR='Error occurred';
window.TEXT_PREVIEW='preview';
window.TEXT_HIDE='hide';
window.TEXT_LOADING='loading';AddEventForControl('dbo.Register', '', 1);

			window.MODE_ADD = 0;
			window.MODE_EDIT = 1;
			window.MODE_SEARCH = 2;
			window.MODE_LIST = 3;
			window.MODE_PRINT = 4;
			window.MODE_VIEW = 5;
			window.MODE_INLINE_ADD = 6;
			window.MODE_INLINE_EDIT = 7;
			window.MODE_EXPORT = 8;
		if(window.flyid<3) window.flyid=3;
;
				// on page load javascript event
				(function(pageid){
						;

					}
				)(1);
			}, 
				1);Runner.util.ScriptLoader.addJS(['customlabels']);
Runner.util.ScriptLoader.addJS(['ajaxsuggest']);
Runner.util.ScriptLoader.addJS(['json']);
Runner.util.ScriptLoader.addJS(['cookies']);
Runner.util.ScriptLoader.addJS(['runnerJS/RunnerControls']);
Runner.util.ScriptLoader.load(1);</script>

<script type="text/javascript">

function OnPageLoadAdd(pageid)
{
var tName = 'dbo.Register';
var ctrlCountry = Runner.controls.ControlManager.getAt(tName, pageid, 'education');
var ctrlState = Runner.controls.ControlManager.getAt(tName, pageid, 'Imagename');

ctrlCountry.on('change', function(e){
     if (this.getValue() == 'Sector 2'){
          ctrlState.setEnabled();
         // ctrlState.addValidation("IsRequired");
     }else{
          ctrlState.setDisabled();
          ctrlState.setValue("");
          //ctrlState.removeValidation("IsRequired");
     }
});
}
</script>

</body>
</html>

This is how the page looks as from View Source.... This was generated using the ASPRunner 6.2

<html lang="en">
<head><title>Register</title>
<link REL="stylesheet" href="include/style.css" type="text/css">
<!--[if IE]>
<link REL="stylesheet" href="include/styleIE.css" type="text/css">
<![endif]-->

<style>
#center_block1 {width:500px;margin:0 auto;}
#contents_block1 {text-align:center;}
#header_block1 {white-space:nowrap;height:31px;padding-top:5px;text-align:center;}
#fields_block1 {width:100%}
#buttons_block1 {padding-bottom:5px;white-space:nowrap;text-align:center;}
#required_block1 {text-align:left;padding:5px}
</style>

</head>
<body>

			<script type="text/javascript">
				window.debugMode = false;
			</script><script language="JavaScript" src="include/jquery.js"></script>
<script language="JavaScript" src="include/jsfunctions.js"></script>

<script type="text/javascript" src="include/runnerJS/RunnerBase.js"></script><script language="JavaScript" src="include/jsfunctions.js"></script>
<div id="search_suggest"></div>


<form name="editform1" id="editform1" encType="multipart/form-data" method="post" action="Register_add.asp" onsubmit="$('#message_block1').html('');var valRes = checkValidSimplePage('editform1','dbo.Register'); return valRes;"><input type=hidden name="a" value="added">
<TABLE class="main_table2" align="center" id="center_block1" cellpadding=0 cellspacing=0><tr><td id="contents_block1">

<div>
<div id="header_block1" class="upeditmenu" >
Register, Add new record
</div>


<div id="message_block1" class="downedit"><div class='message '></div></div>


<table cellpadding=4 cellspacing=0 border=0 id="fields_block1">

  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	Name
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_Name_0" style="white-space: nowrap;"><input id="value_Name_1" style="" type="text" name="value_Name_1"  maxlength=250 value=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newTextField1 = new Runner.controls.TextField({
		fieldName: 'Name', 
		goodFieldName: 'Name',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script></span>
  </td></tr>

  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	Gender
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_Gender_0" style="white-space: nowrap;"><input id="value_Gender_1" style="" type="text" name="value_Gender_1"  maxlength=250 value=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newTextField1 = new Runner.controls.TextField({
		fieldName: 'Gender', 
		goodFieldName: 'Gender',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script></span>
  </td></tr>


  <tr><td class=editshade_b width=150 style="padding-left:15px;">

	Education
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_education_0" style=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newDropDownLookup1 = new Runner.controls.DropDownLookup({
		fieldName: 'education', 
		goodFieldName: 'education',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script><select size = "1" id="value_education_1" name="value_education_1"><option value="">Please select</option><option value="1">Sector 1</option><option value="2">Sector 2</option><option value="3">Sector 3</option><option value="4">Sector 4</option><option value="5">Sector 5:</option><option value="6">Sector 6:</option><option value="7">Sector 7:</option><option value="8">Sector 8:</option><option value="9">Sector 9:</option><option value="10">(N/A) admin Role</option><option value="11">tyftyfytf</option></select></span>

  </td></tr>


  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	Collage
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_Collage_0" style=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newCheckBoxLookup1 = new Runner.controls.CheckBoxLookup({
		fieldName: 'Collage', 
		goodFieldName: 'Collage',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register', multiSel: 2}); 
			}, 1);
		 </script><input id="type_Collage_1" type=hidden name="type_Collage_1" value="multiselect"><div align='left'><input id="value_Collage_1" type="checkbox"  name="value_Collage_1[]" value="test"/>&nbsp;<b id="data_value_Collage_1_0">test</b><br/><input id="value_Collage_1" type="checkbox"  name="value_Collage_1[]" value="tree"/>&nbsp;<b id="data_value_Collage_1_1">tree</b><br/><input id="value_Collage_1" type="checkbox"  name="value_Collage_1[]" value="sdvcvcv"/>&nbsp;<b id="data_value_Collage_1_2">sdvcvcv</b><br/><input id="value_Collage_1" type="checkbox"  name="value_Collage_1[]" value="jhghf"/>&nbsp;<b id="data_value_Collage_1_3">jhghf</b><br/></div></span>

  </td></tr>


  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	Hodid you hear
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_Hodid_you_hear_0" style="white-space: nowrap;"><input id="value_Hodid_you_hear_1" style="" type="text" name="value_Hodid_you_hear_1"  maxlength=250 value=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newTextField1 = new Runner.controls.TextField({
		fieldName: 'Hodid you hear', 
		goodFieldName: 'Hodid_you_hear',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script></span>
  </td></tr>

  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	what do you think
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_what_do_you_think_0" style="white-space: nowrap;"><input id="value_what_do_you_think_1" style="" type="text" name="value_what_do_you_think_1"  maxlength=250 value=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newTextField1 = new Runner.controls.TextField({
		fieldName: 'what do you think', 
		goodFieldName: 'what_do_you_think',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script></span>
  </td></tr>


  <tr><td class=editshade_b width=150 style="padding-left:15px;">

	Your Email
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_your_email_0" style="white-space: nowrap;"><input id="value_your_email_1" style="" type="text" name="value_your_email_1"  maxlength=250 value=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newTextField1 = new Runner.controls.TextField({
		fieldName: 'your email', 
		goodFieldName: 'your_email',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,validationArr: ['IsEmail'],mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script></span>
  </td></tr>


  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	Imagename
  </td>

  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_Imagename_0" style="white-space: nowrap;"><input id="value_Imagename_1" style="" type="text" name="value_Imagename_1"  maxlength=250 value=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newTextField1 = new Runner.controls.TextField({
		fieldName: 'Imagename', 
		goodFieldName: 'Imagename',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register'}); 
			}, 1);
		 </script></span>
  </td></tr>


  <tr><td class=editshade_b width=150 style="padding-left:15px;">
	Upload Image
  </td>
  <td width=250 class=editshade_lb style="padding-left:10px;">
    <span id="edit1_UploadImage_0" style=""><script  language='javascript'>
			Runner.util.ScriptLoader.addBe4PostLoad(function(){
				var newFileField1 = new Runner.controls.FileField({
		fieldName: 'UploadImage', 
		goodFieldName: 'UploadImage',
		shortTableName: 'Register',
		id: '1',
		ctrlInd: 0,mode: 0,table: 'dbo.Register', addTimeStamp: 'true'}); 
			}, 1);
		 </script><input id="type_UploadImage_1" type="hidden" name="type_UploadImage_1" value="upload2"><input type="File" id="value_UploadImage_1"  name="value_UploadImage_1" ><br>Filename&nbsp;&nbsp;<input type="text" id="filename_UploadImage_1" name="filename_UploadImage_1" size="50" maxlength="100"></span>

  </td></tr>

</table>

<div class="toplist" id="buttons_block1">
	
	<br/>
	
	<span class=buttonborder><input class=button type=submit value="Save" name=submit1 ></span>
	
	
	
	<span class=buttonborder><input class=button type=button value="Back to list" onclick="window.location.href='Register_list.asp?a=return'"></span>
	
</div>
</div>

</td></tr>

</table>
</form>

<br><br>

<script>Runner.util.ScriptLoader.addPostLoadStep(function()
			{				
				setButtonBorderStyle();
				window.TEXT_MONTH_JAN='January';
window.TEXT_MONTH_FEB='February';
window.TEXT_MONTH_MAR='March';
window.TEXT_MONTH_APR='April';
window.TEXT_MONTH_MAY='May';
window.TEXT_MONTH_JUN='June';
window.TEXT_MONTH_JUL='July';
window.TEXT_MONTH_AUG='August';
window.TEXT_MONTH_SEP='September';
window.TEXT_MONTH_OCT='October';
window.TEXT_MONTH_NOV='November';
window.TEXT_MONTH_DEC='December';
window.TEXT_DAY_SU='Su';
window.TEXT_DAY_MO='Mo';
window.TEXT_DAY_TU='Tu';
window.TEXT_DAY_WE='We';
window.TEXT_DAY_TH='Th';
window.TEXT_DAY_FR='Fr';
window.TEXT_DAY_SA='Sa';
window.TEXT_TODAY='today';
window.TEXT_SELECT_DATE = 'Select Date';
window.TEXT_INVALID_CAPTCHA_CODE='Invalid security code.';

window['tName1'] = 'dbo.Register';
window.TEXT_INLINE_FIELD_REQUIRED='Required field';
window.TEXT_INLINE_FIELD_ZIPCODE='Field should be a valid zipcode';
window.TEXT_INLINE_FIELD_EMAIL='Field should be a valid email address';
window.TEXT_INLINE_FIELD_NUMBER='Field should be a valid number';
window.TEXT_INLINE_FIELD_CURRENCY='Field should be a valid currency';
window.TEXT_INLINE_FIELD_PHONE='Field should be a valid phone number';
window.TEXT_INLINE_FIELD_PASSWORD1='Field can not be \'password\'';
window.TEXT_INLINE_FIELD_PASSWORD2='Field should be at least 4 characters long';
window.TEXT_INLINE_FIELD_STATE='Field should be a valid US state name';
window.TEXT_INLINE_FIELD_SSN='Field should be a valid Social Security Number';
window.TEXT_INLINE_FIELD_DATE='Field should be a valid date';
window.TEXT_INLINE_FIELD_TIME='Field should be a valid time in 24-hour format';
window.TEXT_INLINE_FIELD_CC='Field should be a valid credit card number';
window.TEXT_INLINE_FIELD_SSN='Field should be a valid Social Security Number';

window.TEXT_PLEASE_SELECT='Please select';
window.current_language='English';

window.locale_dateformat = '1';
window.locale_datedelimiter = '-';
window.bLoading=false;

window.TEXT_CTRL_CLICK = "CTRL + click for multiple sorting";
window.TEXT_SAVE='Save';
window.TEXT_CANCEL='Cancel';
window.TEXT_INLINE_ERROR='Error occurred';
window.TEXT_PREVIEW='preview';
window.TEXT_HIDE='hide';
window.TEXT_LOADING='loading';AddEventForControl('dbo.Register', '', 1);

			window.MODE_ADD = 0;
			window.MODE_EDIT = 1;
			window.MODE_SEARCH = 2;
			window.MODE_LIST = 3;
			window.MODE_PRINT = 4;
			window.MODE_VIEW = 5;
			window.MODE_INLINE_ADD = 6;
			window.MODE_INLINE_EDIT = 7;
			window.MODE_EXPORT = 8;
		if(window.flyid<3) window.flyid=3;
;
				// on page load javascript event
				(function(pageid){
						;

					}
				)(1);
			}, 
				1);Runner.util.ScriptLoader.addJS(['customlabels']);
Runner.util.ScriptLoader.addJS(['ajaxsuggest']);
Runner.util.ScriptLoader.addJS(['json']);
Runner.util.ScriptLoader.addJS(['cookies']);
Runner.util.ScriptLoader.addJS(['runnerJS/RunnerControls']);
Runner.util.ScriptLoader.load(1);</script>

<script type="text/javascript">

function OnPageLoadAdd(pageid)
{
var tName = 'dbo.Register';
var ctrlCountry = Runner.controls.ControlManager.getAt(tName, pageid, 'education');
var ctrlState = Runner.controls.ControlManager.getAt(tName, pageid, 'Imagename');

ctrlCountry.on('change', function(e){
     if (this.getValue() == 'Sector 2'){
          ctrlState.setEnabled();
         // ctrlState.addValidation("IsRequired");
     }else{
          ctrlState.setDisabled();
          ctrlState.setValue("");
          //ctrlState.removeValidation("IsRequired");
     }
});
}
</script>

</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.