");document.write("");document.write("");document.write("");
var f1_sei = "";
var f1_mei = "";
var f2_1 = "";
var f3_1 = "";
var f3_2 = "";
var f3_3 = "";
var f4_zip_1 = "";
var f4_zip_2 = "";
var f4_todofuken = "";
var f4_address_1 = "";
var f4_address_2 = "";
var f5 = "";
var inputHtmlTmp="
";
var output="";
function nl2br(input){
var output = input;
while(output.match(/\n/)){
output = output.replace(/\n/, "
");
}
return output;
}
function escape_html(input){
var output = input;
output = output.replace(/&/g, "&");
output = output.replace(/"/g, """);
output = output.replace(/'/g, "'");
output = output.replace(//g, ">");
return output;
}
function trim(input) {
return input.replace(/^[\s ]+|[\s ]+$/g, '');
}
function hookXhr()
{
if( !window.XDomainRequest ) return undefined;
var xhr = function(){
this.readyState = 0; // uninitialized
this.responseText = "";
this.status = "";
this.onreadstatechange = undefined;
var xdr = new XDomainRequest();
xdr.onprogress = function(){
var f;
this.xhr.readyState = 2; // loaded
if( this.xhr && ( f = this.xhr.onreadystatechange ) ){
f.apply( this.xhr );
}
};
if(!xdr.getAllResponseHeaders) {
xdr.getAllResponseHeaders = $.noop;
}
xdr.onload = function(){
var f;
this.xhr.readyState = 3; // interactive
if( this.xhr && ( f = this.xhr.onreadystatechange ) ){
f.apply( this.xhr );
}
this.xhr.responseText = xdr.responseText;
this.xhr.readyState = 4; // complete
this.xhr.status = "200";
if( f ){
f.apply( this.xhr );
}
};
this.open = function( method, url, async ){
return xdr.open( method, url, async );
readyState = 1;
}
this.send = function( body ){
xdr.send( body );
};
this.setRequestHeader = function( headerName, headerValue ){
};
this.getAllResponseHeaders = function(){
};
this.getResponseHeader = function( headerName ){
if( headerName.match( /^Content\-Type$/i ) ){
return xdr.contentType;
}else{
return "";
}
};
xdr.xhr = this;
return this;
};
return new xhr();
}
var handleSuccess = function(data, dataType) {
var obj = JSON.parse(data);
if(obj.ret != '0') {
$('#mailformasp_txt_explain').html(obj.message);
}
}
var handleError = function(XMLHttpRequest, textStatus, errorThrown){
$('#mailformasp_txt_explain').html('
メールの送信に失敗しました。');
}
var handleComplete = function(XMLHttpRequest, textStatus) {
}
function onInput(){
document.write('
' + output + '
');
}
function onTop(){
inputHtml.innerHTML = output;
document.mailformasp.maildata_1_sei.value = f1_sei;
document.mailformasp.maildata_1_mei.value = f1_mei;
document.mailformasp.maildata_2_1.value = f2_1;
document.mailformasp.maildata_3_1.value = f3_1;
document.mailformasp.maildata_3_2.value = f3_2;
document.mailformasp.maildata_3_3.value = f3_3;
document.mailformasp.maildata_4_zip_1.value = f4_zip_1;
document.mailformasp.maildata_4_zip_2.value = f4_zip_2;
document.mailformasp.maildata_4_todofuken.value = f4_todofuken
document.mailformasp.maildata_4_address_1.value = f4_address_1;
document.mailformasp.maildata_4_address_2.value = f4_address_2;
document.mailformasp.maildata_5.value = f5;
}
function onConfirm(){
var result = false;
var result = errCheck();
if (result){
return false;
} else {
f1_sei = document.mailformasp.maildata_1_sei.value;
f1_mei = document.mailformasp.maildata_1_mei.value;
f2_1 = document.mailformasp.maildata_2_1.value;
f3_1 = document.mailformasp.maildata_3_1.value;
f3_2 = document.mailformasp.maildata_3_2.value;
f3_3 = document.mailformasp.maildata_3_3.value;
f4_zip_1 = document.mailformasp.maildata_4_zip_1.value;
f4_zip_2 = document.mailformasp.maildata_4_zip_2.value;
f4_todofuken = document.mailformasp.maildata_4_todofuken.value;
f4_address_1 = document.mailformasp.maildata_4_address_1.value;
f4_address_2 = document.mailformasp.maildata_4_address_2.value;
f5 = document.mailformasp.maildata_5.value;
document.getElementById("inputHtml").innerHTML = output2;
document.getElementById("maildata_1_value").innerHTML = escape_html(f1_sei + " " + f1_mei);
document.getElementById("maildata_2_value").innerHTML = escape_html(f2_1);
document.getElementById("maildata_3_value").innerHTML = escape_html(f3_1 + "-" + f3_2 + "-" + f3_3);
document.getElementById("maildata_4_value").innerHTML = escape_html(f4_zip_1 + "-" + f4_zip_2) + "
" + escape_html(f4_todofuken) + escape_html(f4_address_1) + escape_html(f4_address_2);
document.getElementById("maildata_5_value").innerHTML = nl2br(escape_html(f5));
}
}
function onSubmit(){
document.getElementById("inputHtml").innerHTML = output3;
var sendData = {};
sendData.userid = 'whq365190157';
sendData.mailformid = 4454;
sendData.filename = "whq365190157_4454_42961b93";
sendData.action_user_mail_do = "true";
sendurl="https://seikinkabu.netowl-mailform.jp/mailpost.cgi";
var userAgent = window.navigator.userAgent.toLowerCase();
if(userAgent.indexOf('msie') != -1) {
if(document.location.protocol == 'http:') {
sendurl = sendurl.replace('https://', 'http://');
}
}
sendData = getSendData(sendData);
var res;
jQuery.support.cors = true;
res = new $.ajax({
url: sendurl,
type: "POST",
data: sendData,
dataType: "text",
xhr : window.XDomainRequest ? hookXhr : undefined,
success: handleSuccess,
error: handleError,
complete: handleComplete
});
}
function getSendData(sendData){
sendData.maildata_1_sei = f1_sei;
sendData.maildata_1_mei = f1_mei;
sendData.maildata_2_1 = f2_1;
sendData.maildata_3 = f3_1 + "-" + f3_2 + "-" + f3_3;
sendData.maildata_3_1 = f3_1;
sendData.maildata_3_2 = f3_2;
sendData.maildata_3_3 = f3_3;
sendData.maildata_4_zip_1 = f4_zip_1;
sendData.maildata_4_zip_2 = f4_zip_2;
sendData.maildata_4_todofuken = f4_todofuken;
sendData.maildata_4_address_1 = f4_address_1;
sendData.maildata_4_address_2 = f4_address_2;
sendData.maildata_5 = f5;
return sendData;
}
function formReset(){
document.mailformasp.maildata_1_sei.value = "";
document.mailformasp.maildata_1_mei.value = "";
document.mailformasp.maildata_2_1.value = "";
document.mailformasp.maildata_3_1.value = "";
document.mailformasp.maildata_3_2.value = "";
document.mailformasp.maildata_3_3.value = "";
document.mailformasp.maildata_4_zip_1.value = "";
document.mailformasp.maildata_4_zip_2.value = "";
document.mailformasp.maildata_4_todofuken.value = "";
document.mailformasp.maildata_4_address_1.value = "";
document.mailformasp.maildata_4_address_2.value = "";
document.mailformasp.maildata_5.value = "";
f3_1 = "";
f3_2 = "";
f3_3 = "";
f4_zip_1 = "";
f4_zip_2 = "";
f4_todofuken = "";
f4_address_1 = "";
f4_address_2 = "";
f5 = "";
}
function errCheck(){
var result = false;
$("#1_err").html("");
document.mailformasp.maildata_1_sei.value = trim(document.mailformasp.maildata_1_sei.value)
document.mailformasp.maildata_1_mei.value = trim(document.mailformasp.maildata_1_mei.value)
if (errEmptyCheck(document.mailformasp.maildata_1_sei.value) || errEmptyCheck(document.mailformasp.maildata_1_mei.value)){
result = true;
$("#1_err").html("名前は必須項目です。");
} else {
$("#1_err").html("");
}
var f1_error_message = "";
var f1_input_flg = true;
if (checkMojiCount(document.mailformasp.maildata_1_sei.value, 50) == false){
if(f1_error_message != "") {
f1_error_message += "
";
}
f1_error_message += "姓は50文字以内で入力してください。";
f1_input_flg = false;
}
if (checkMojiCount(document.mailformasp.maildata_1_mei.value, 50) == false){
if(f1_error_message != "") {
f1_error_message += "
";
}
f1_error_message += "名は50文字以内で入力してください。";
f1_input_flg = false;
}
if (f1_input_flg == false){
result = true;
if ($("#1_err").html()!= ""){
f1_error_message = $("#1_err").html() + "
"+f1_error_message;
}
$("#1_err").html(f1_error_message);
}
$("#2_err").html("");
document.mailformasp.maildata_2_1.value = trim(document.mailformasp.maildata_2_1.value)
if (errEmptyCheck(document.mailformasp.maildata_2_1.value)){
result = true;
$("#2_err").html("メールアドレスは必須項目です。");
} else {
$("#2_err").html("");
}
var f2_error_message = "";
if (isMailaddress(document.mailformasp.maildata_2_1.value) == false){
result = true;
f2_error_message += "メールアドレスを入力してください。";
if ($("#2_err").html()!= ""){
f2_error_message = $("#2_err").html() + "
"+f2_error_message;
}
$("#2_err").html(f2_error_message);
}
var f2_error_message = "";
if (checkMojiCount(document.mailformasp.maildata_2_1.value, 100) == false){
result = true;
f2_error_message += "メールアドレスは100文字以内で入力してください。";
if ($("#2_err").html()!= ""){
f2_error_message = $("#2_err").html() + "
"+f2_error_message;
}
$("#2_err").html(f2_error_message);
}
$("#3_err").html("");
document.mailformasp.maildata_3_1.value = trim(document.mailformasp.maildata_3_1.value)
document.mailformasp.maildata_3_2.value = trim(document.mailformasp.maildata_3_2.value)
document.mailformasp.maildata_3_3.value = trim(document.mailformasp.maildata_3_3.value)
var f3_error_message = "";
if (isTelSplit(document.mailformasp.maildata_3_1.value, document.mailformasp.maildata_3_2.value, document.mailformasp.maildata_3_3.value) == false){
result = true;
f3_error_message += "連絡先を入力してください。";
if ($("#3_err").html()!= ""){
f3_error_message = $("#3_err").html() + "
"+f3_error_message;
}
$("#3_err").html(f3_error_message);
}
$("#4_err").html("");
document.mailformasp.maildata_4_zip_1.value = trim(document.mailformasp.maildata_4_zip_1.value)
document.mailformasp.maildata_4_zip_2.value = trim(document.mailformasp.maildata_4_zip_2.value)
document.mailformasp.maildata_4_address_1.value = trim(document.mailformasp.maildata_4_address_1.value)
document.mailformasp.maildata_4_address_2.value = trim(document.mailformasp.maildata_4_address_2.value)
var f4_error_message = "";
var f4_input_flg = true;
if (checkMojiCount(document.mailformasp.maildata_4_address_1.value, 1000) == false){
if(f4_error_message != "") {
f4_error_message += "
";
}
f4_error_message += "市区町村番地は1000文字以内で入力してください。";
f4_input_flg = false;
}
if (checkMojiCount(document.mailformasp.maildata_4_address_2.value, 1000) == false){
if(f4_error_message != "") {
f4_error_message += "
";
}
f4_error_message += "マンション・ビル名は1000文字以内で入力してください。";
f4_input_flg = false;
}
if (f4_input_flg == false){
result = true;
if ($("#4_err").html()!= ""){
f4_error_message = $("#4_err").html() + "
"+f4_error_message;
}
$("#4_err").html(f4_error_message);
}
var f4_error_message = "";
if (isZip1(document.mailformasp.maildata_4_zip_1.value) == false || isZip2(document.mailformasp.maildata_4_zip_2.value) == false){
result = true;
f4_error_message += "郵便番号を入力してください。";
if ($("#4_err").html()!= ""){
f4_error_message = $("#4_err").html() + "
"+f4_error_message;
}
$("#4_err").html(f4_error_message);
}
$("#5_err").html("");
if (errEmptyCheck(document.mailformasp.maildata_5.value)){
result = true;
$("#5_err").html("問い合わせ内容は必須項目です。");
} else {
$("#5_err").html("");
}
var f5_error_message = "";
if (checkMojiCount(document.mailformasp.maildata_5.value, 5000) == false){
result = true;
f5_error_message += "問い合わせ内容は5000文字以内で入力してください。";
if ($("#5_err").html()!= ""){
f5_error_message = $("#5_err").html() + "
"+f5_error_message;
}
$("#5_err").html(f5_error_message);
}
return result;
}
function errEmptyCheck(str){
if (str == ""){
return true;
} else {
return false;
}
}
output="
";output2="
";output3="
";onInput();
-->