【问题标题】:confirm box, then with input box and verify the content确认框,然后用输入框验证内容
【发布时间】:2013-03-10 01:32:41
【问题描述】:

是否可以通过简单的确认,在jsp中提示并获取值并返回主页进行下一步操作来实现以下一系列操作?

顺序操作:单击取消链接->确认框弹出->提示框以获取更多信息->单击确定按钮,主页获取输入文本并传递给取消功能。

这是我到目前为止所拥有的,但它似乎有问题,但我不知道我是否必须为此使用 div。

非常感谢!

<a class="action" href="manualCancel?obj={{objectId}}&cancel={{cancelInfo}}" onclick="return createCancel('cancel this ({{ objectId }})')">Cancel</a>


function createCancel(action) {
    ret = confirm('Are you sure you want to ' + action + '?')
    if (ret) {
        var cancelInfo;
        do {
            cancelInfo = prompt('Please provide valid cancel reason', '');
        }
        while(cancelInfo.length < 4){
            dim()
            return true;
        }
        return false;
    }
    return false;
}

【问题讨论】:

    标签: javascript jsp


    【解决方案1】:

    使用location.href

    <a class="action" href="#" onclick="createCancel('cancel this ({{ objectId }})')">Cancel</a>
    
    
    function createCancel(action) {
        ret = confirm('Are you sure you want to ' + action + '?')
        if (ret) {
            var cancelInfo;
            do {
                cancelInfo = prompt('Please provide valid cancel reason', '');
            }
            while(cancelInfo.length < 4){
                dim()
            }
            location.href = 'manualCancel?obj={{objectId}}&cancel=' + cancelInfo;
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2014-10-08
      • 1970-01-01
      • 2014-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多