0

这是我更新的小提琴......

http://jsfiddle.net/sweety/XarqB/3/

我收到警报框,但我需要的是当我单击警报中的“是”按钮时,我需要使用选定的选项保存页面

     <form method="post" action="/echo/html/">
           <input type="hidden" name="html" value="&lt;p&gt;Your data has been  
             deleted&lt/p&gt;" />
           <select id="sel" name="sel" onchange="callMe()">
            <option>1</option>
            <option>2</option>
            <option>3</option>
           </select>
           </form>
          <div id="confirmBox">
               <div class="message"></div>
                  <span class="button yes">Yes</span>
                  <span class="button no">No</span>
                </div>
4

2 回答 2

1

.html 文件:

<select id="sel" name="sel" onchange="return callMe()">
    <option>1</option>
    <option>2</option>
    <option>3</option>
</select>

javascript函数

<script>
function callMe()
{
    var ans = confirm("Are You Sure To Save This Record...");
    if(ans)
    {
        //go to ur process/query page
        //return true;
    }
    else
    {
        return false;   
    }
}
</script>
于 2013-09-26T09:57:56.757 回答
0

只需删除您的代码,我不知道您为什么将Submit按钮放入select

JS

function alert(){
alert("Here you go");
}

html

<select id="abc" name="abc" onchange="alert();" >
<option>This is option1</option>
<option>This is option2</option>
</select>
于 2013-09-26T09:58:57.787 回答