2

以下のスニペットを使用してユーザー入力を許可し、後でその入力値を取得する

alertify.prompt('Please enter your comments', 'some value', 
    function(evt, value){ alertify.message('You entered: ' + value);}
);


alertify.confirm("Are you sure you want to submit data for selected date range ?", function (e) {

alertify.prompt('Please enter Desc:').set('type', 'text'); 
alertify.prompt('This is a prompt dialog!', '', function(evt, value){  
    alertify.message('You entered: ' + value);
});              

//fetch user input value here and pass in URL
var user_value = value;

if (e) {
    alertify.success("Data has been submitted");
    $.post(
        SITE_URL+"someurl/action",
        $("#frm_submit").serialize()+ "&res_ids="+res_ids,
        function( data ) {
            window.location.href='<?php echo SITE_URL."someurl/action?project_id=".$_GET['project_id']."&action=submit"; ?>';
    });
} else {
    alertify.error("Your data is not submitted");
}

しかし、それは以下の例外をスローします

Error: fn must be a function
..."!=typeof c&&"function"!=typeof c)throw new Error("fn must be a function");retur...

フォームを送信する前に、テキストエリアでユーザー入力を許可し、その値を取得して URL に渡すにはどうすればよいですか?

バージョン -v0.3.11

4

0 に答える 0