3

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

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.

Can anyone help me?

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

This is how I insert 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.

Can anyone help me?

1
  • Dejan.S : Showing my answer is not the problem. That I can do. Commented May 21, 2015 at 7:10

1 Answer 1

2

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" );
            }
        }
    ]
});

fiddle: http://jsfiddle.net/s9ff3gjs/1/

Sign up to request clarification or add additional context in comments.

1 Comment

your code looks like good but in your code js and html are together in html window, i think this is better way : jsfiddle.net/ent1c3d/s9ff3gjs/2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.