gpt4 book ai didi

javascript - 在提交表单时打开一个模式对话框,其中包含该表单的所有值

转载 作者:行者123 更新时间:2023-11-28 08:24:47 26 4
gpt4 key购买 nike

我有一个 MVC4.0 网站,屏幕上有一个按钮。根据我的要求,我通过单击该按钮提交了一个包含一些隐藏值的隐藏表单。我的要求是

我必须打开一个包含所有这些隐藏值的模型对话框。

请给我一些解决方案。

//under a Beginform of a view this button code is written

<input type="button" id="idBtnScan" name="btnName" value="Scan" onclick="javascript:subProcessURL()" />

//I have add this hidden form on click of this button
//@Model.UDConfig.sScanningURL = is the url of the another website's default page
//Model.UDConfig.listScanData (list) that contains all parameter that takes another website.

<form id="idFormSelect" action ="@Model.UDConfig.sScanningURL" method="post" >
<div class="makeHidden">
@for(int i=0;i<Model.UDConfig.listScanData.Count;i++)
{
<input type="text" id="@Model.UDConfig.listScanData[i].sKey" name="@Model.UDConfig.listScanData[i].sKey" value ="@Model.UDConfig.listScanData[i].sValue" />
}
<input type="text" id="ASPUserSessionId" name="ASPUserSessionId" value="@Session.SessionID" />
<input type="submit" name="SubmitDetails" />
</div>
</form>


<script type ="text/javascript" >
function subProcessID() {

window.showModalDialog("@Model.UDConfig.sScanningURL", "#idFormSelect", "dialogWidth:700px;dialogHeight:500px;scroll:no;")
$("#idFormSelect").submit();
}

</script>

$("#idBtnScan")[0].onclick = function () {
HideDivInfoNErrorMsg();
ShowOverlay_Base();
subProcessURL();
@*$.ajax({
//type: "POST",
//url: "@Url.Action("GetSingleScanURL", "CreationOutward")",
//success: function (data) {
//window.showModalDialog(data, "", "dialogWidth:700px;dialogHeight:500px;scroll:no;")*@

//functionality of view image
$.ajax({
type: "POST",
url: "@Url.Action("ActionViewImage", "CreationOutward")",
success: function (dataImage) {

HideDivInfoNErrorMsg();
if ((dataImage == "Image not found")
|| (dataImage == "Image Folder not found")
|| (dataImage == "Error in processing image")
|| (dataImage == "Multiple Images found")) {
$("#DivInfoNErrorMsg")[0].innerHTML = "<div class=\"errormessage\"><span>".concat(dataImage, "</span></div>");
DisplayInfoNErrorMsg();
}
else {
$("#divImgView")[0].innerHTML = dataImage;
HideDivInfoNErrorMsg();
}

HideOverlay_Base();
}
})
//View Image till here

//}
//}
// )
}

最佳答案

您的按钮调用了一个名为“subProcessURL”的 JavaScript 函数,但在您的代码中只有一个 subProcessID 函数。这些不匹配

关于javascript - 在提交表单时打开一个模式对话框,其中包含该表单的所有值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22559068/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com