小编Rol*_*olf的帖子

如何将图像用作提交按钮?

有人可以帮助改变它,以包含一个名为BUTTON1.JPG而不是标准submit按钮的图像?

<form id='formName' name='formName' onsubmit='redirect();return false;'>
    <div class="style7">
        <input type='text' id='userInput' name='userInput' value=''>
        <input type='submit' name='submit' value='Submit'>
    </div>
</form> 
Run Code Online (Sandbox Code Playgroud)

html form-submit submit-button

43
推荐指数
3
解决办法
14万
查看次数

我如何结合多个案例?

可能重复:
交换机案例中的JavaScript或表达式

case 'att':
   window.location.replace('/att-Forms.htm');
   break;
case 'at&t':
   window.location.replace('/att-Forms.htm');    
   break;
Run Code Online (Sandbox Code Playgroud)

有没有办法用某种"或"功能来缩短它?

javascript case

5
推荐指数
2
解决办法
9971
查看次数

如何使案例功能不区分大小写?

        <script type='text/javascript'>
        function redirect() {
            var input = document.getElementById('userInput').value;
            switch(input) {
                case 'ALCOA':
                    window.location.replace('alcoa-Forms.htm');
                    break;
                case 'alcoa':
                    window.location.replace('/alcoa-Forms.htm');    
                    break;
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能让这个函数不区分大小写,所以我只能写一次?

javascript case

3
推荐指数
1
解决办法
3534
查看次数

标签 统计

case ×2

javascript ×2

form-submit ×1

html ×1

submit-button ×1