jQuery对话框作为输入

编程入门 行业动态 更新时间:2024-10-11 17:30:44
本文介绍了jQuery对话框作为输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我不太习惯使用jquery对话框和其他东西. 所以这是一个新手问题.

I'm not very used to working with jquery dialogs and stuff. So this is kind of a newbie question.

此刻,我正在使用提示从SharePoint中的用户那里得到答复.

At this moment I'm using the prompt to get a reply from the user in my SharePoint.

var answer = dialog("Type the text you want to display in the email.");

但是我的输入受到限制.

But then my input is limited.

有人可以帮助我吗?

添加. 现在,我可以插入对话框了.但是我无法显示它.

Addition. I was now able to insert my dialog. But I'm not able to display it.

这是我插入的方式:

if ($("#dialogSendMail").length) { } else { $("#DeltaPlaceHolderUtilityContent").after("<div id='dialogSendMail' title='Enter mail body'> <label for='mailBody'>Type the text you want to display in the email:</label><p><input type='text' id='mailBody' name='mailBody'></p></div>"); }

这是我尝试显示的方式:

And this is how I try to display it:

var answer =""; $( "#dialogSendMail" ).dialog({ resizable: false, height:350, width:650, modal: true, autoOpen : false, buttons: [ { text: "Send Mail", click: $.noop, type: "submit", form: "myForm" }, { text: "Close", click: function () { $(this).dialog("close"); } } ] });

但是当我运行代码时,它不会显示对话框. 另外,我正在尝试找到一种从文本框中获取响应的方法.

But when I run my code, it doesn't display the dialog. Additionally i'm trying to find a way to get the response from the textbox.

有人可以帮助我吗?

推荐答案

纯jquery没有此类对话框,请改用jquery UI. 你真正的问题是什么?

There are no such dialog for pure jquery, use jquery UI instead. What is your real question?

$( "form" ).dialog({ open: function() { // On open, hide the original submit button $( this ).find( "[type=submit]" ).hide(); }, buttons: [ { text: "Find", click: $.noop, type: "submit", form: "myForm" }, { text: "Close", click: function() { $( this ).dialog( "close" ); } } ] });

小提琴: jsfiddle/s9ff3gjs/1/

更多推荐

jQuery对话框作为输入

本文发布于:2023-11-28 03:53:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1640850.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对话框   jQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!