From 3d301812d64b72b65c651fb8cbf81b6f9e65dc93 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 14 Oct 2010 20:45:35 +0000 Subject: [PATCH] restore update_censustract RT10221 --- httemplate/edit/cust_main/bottomfixup.js | 73 ++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js index 4d9ef070d..942fc0e66 100644 --- a/httemplate/edit/cust_main/bottomfixup.js +++ b/httemplate/edit/cust_main/bottomfixup.js @@ -54,6 +54,79 @@ function post_geocode() { } +var set_censustract; + +function update_censustract(arg) { + + var argsHash = eval('(' + arg + ')'); + + var cf = document.CustomerForm; + + var msacode = argsHash['msacode']; + var statecode = argsHash['statecode']; + var countycode = argsHash['countycode']; + var tractcode = argsHash['tractcode']; + var error = argsHash['error']; + + var newcensus = + new String(statecode) + + new String(countycode) + + new String(tractcode).replace(/\s$/, ''); // JSON 1 workaround + + set_censustract = function () { + + cf.elements['censustract'].value = newcensus + cf.submit(); + + } + + if (error || cf.elements['censustract'].value != newcensus) { + // popup an entry dialog + + if (error) { newcensus = error; } + newcensus.replace(/.*ndefined.*/, 'Not found'); + + var choose_censustract = + '

Confirm censustract
' + + 'Map service module location
' + + 'Map zip code center

' + + ''; + + choose_censustract = choose_censustract + + '' + + '' + + '' + + ''; + + choose_censustract = choose_censustract + + '' + + '' + + + '
Entered census tractCalculated census tract
' + cf.elements['censustract'].value + + '' + newcensus + '
  
' + + '' + + '' + + '' + + '
' + + '
'; + + overlib( choose_censustract, CAPTION, 'Confirm censustract', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 ); + + } else { + + cf.submit(); + + } + +} + function copyelement(from, to) { if ( from == undefined ) { to.value = ''; -- 2.11.0