// copyright 2009 DTLink, LLC. http://www.dtlink.com
//
// sends the SHA256 hash for a given field

function fv_sendSHA256( parms )
{

var formName = parms.formName;
var inFieldName = parms.inFieldName;
var outFieldName = parms.outFieldName;

// if the outfile doesn't exist, create it.

if ( $("form[name=" + formName + "] input[name=" + outFieldName + "]").length == 0 )
	{
	$("form[name=" + formName + "]").append( "<input type=\"hidden\" name=\"" + outFieldName + "\"/>" );
	}

// get the value of the infield

var fieldValue = $( "form[name=" + formName + "] :input[name=" + inFieldName + "]" ).val();
$( "form[name=" + formName + "] :input[name=" + inFieldName + "]" ).val("");

// replace the fieldValue with the SHA256 hash.

$("form[name=" + formName + "] :input[name=" + outFieldName + "]").val( hex_sha256( fieldValue ));

return true;
	   
}
						
						

