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...

在提交表单之前,我如何允许用户在 textarea 中输入、获取该值并将其传递到 URL 中?

版本 -v0.3.11

4

0 回答 0