0

我设置了一个脚本,其中有人通过将漫画附加到 URL 来选择要从列表中移出的漫画。但是,我终其一生都无法让它在文本框内接受输入笔划并仍然保持脚本功能。任何解决方案将不胜感激。

脚本/表单如下所示:

function GoToURL(j) { window.status=('Extracting')

var URLis;
 URLis = document.URLframe.Dest.value

   if (URLis == "" || URLis.length <= 0 || URLis > 20 )
       { 
     j.value = "Try Again"
      alert('Pick a comic that exists.');
         window.status=('That comic does not exist.')
           } 
    else
        {
 j.value = "Going" + URLis   
 var location=("aaw" + URLis +".html");
         this.location.href = location;
window.status=('Connecting to ' + URLis + '  Please wait........');
        }
        }
</script>

 <form name="URLframe"> 
<b>Comic #:</b> 
<input type="TEXT" name="Dest" size="5" maxlength="3">
<input type="Button" name="Go to" value="Go" onClick="GoToURL(this)">
</form>

4

1 回答 1

0

两个建议。

  1. 将您的onclick="GoToURL(this)"事件处理程序移动到表单的onsubmit处理程序。
  2. 将您的按钮类型更改为type="submit".
于 2010-02-24T09:57:43.170 回答