html form post 出错,HTML Form method="post" - Stack Overflow

I am trying to understand an existing piece of software, and have come accross the following:

On the screen there is a button with the text "Apply Now", and From what I understand, the inputtags of the HTML create this button.

I am trying to understand what happens in the code when the button is pressed.

Previously, when I have used forms, action has had a value, for example a page name, so I could work out where the code was going.

In this case, action does not have a value. From searching on the internet, it seems this means the form is being submitted to the same page.

My question is, how can I tell where on the page the code is being submitted to? Or, to put it another way, how can I work out what is going on with the code after the button has been pressed?

Is it the case that the page is reloaded again, and all the data that has been filled out in the form is posted to the page and the page loads with that data already loaded?

Here is the JS method fnPreSubmit and any related methods. It seems to me these validate the form before it posts back to the same page?

function fnPreSubmit()

{

var oFrm = document.forms['AppForm'];

// First set any disable inputs back to enabled so that the value gets sent

for (var ii = 0; ii < arrROC.length; ii++)

{

var oReadOnlyInput = oFrm[arrROC[ii][0]];

if (oReadOnlyInput.disabled)

{

oReadOnlyInput.disabled = false;

}

}

// Sort out the date fields

fnProcessDateFields(oFrm);

dataLayer.push({'event': 'ApplicationSubmit'});

return true;

}

function fnProcessDateFields(pFrm)

{

var sName = "";

if (pFrm['datefield'] != undefined)

{

for (var ii = 0; ii < pFrm['datefield'].length; ii++)

{

sName = pFrm['datefield'][ii].value;

pFrm[sName].value = pFrm['date_dd_' + sName].value + '/' + pFrm['date_mm_' + sName].value + '/' + pFrm['date_yyyy_' + sName].value;

}

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值