function ModalDialog() {
var Ret
Ret = window.showModalDialog(
"ModalDialog.htm" ,
window,
"dialogWidth:600px;dialogHeight:500px;help:no;unadorned:yes;edge:sunken"
)
return Ret;
}
<SCRIPT language=VBScript>
Dim pWindow
Dim BodyTextObj,BookMark
Dim strWork
' **********************************************************' 初回サーチ' **********************************************************
function PageSearch()
strWork = document.all("SearchString").value
if strWork = "" then
Exit Function
end if
document.all("SearchNext").disabled = False
document.all("SearchBack").disabled = False
Call BodyTextObj.moveToBookmark( BookMark )
if document.all("SearchOption").checked then
if BodyTextObj.findText( strWork, 0, 4 ) then
Call BodyTextObj.select()
end if
else
if BodyTextObj.findText( strWork ) then
Call BodyTextObj.select()
end if
end if
end function
' **********************************************************' 次候補サーチ' **********************************************************
function PageSearchNext()
strWork = document.all("SearchString").value
if strWork = "" then
Exit Function
end if
Call BodyTextObj.collapse( False )
if document.all("SearchOption").checked then
if BodyTextObj.findText( strWork,9999999,4 ) then
Call BodyTextObj.select()
end if
else
if BodyTextObj.findText( strWork,9999999 ) then
Call BodyTextObj.select()
end if
end if
end function
' **********************************************************' 逆サーチ' **********************************************************
function PageSearchBack()
strWork = document.all("SearchString").value
if strWork = "" then
Exit Function
end if
Call BodyTextObj.collapse( True )
if document.all("SearchOption").checked then
if BodyTextObj.findText( strWork,-9999999,4 ) then
Call BodyTextObj.select()
end if
else
if BodyTextObj.findText( strWork,-9999999 ) then
Call BodyTextObj.select()
end if
end if
end function
</SCRIPT>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=shift_jis">
<STYLE type="text/css">
TD {
font-family:"MS Pゴシック";
font-size:12;
border-width:1;
}
INPUT {
font-family:"MS Pゴシック";
font-size:12;
}
</STYLE>
</HEAD>
<BODY>
<TABLE height=70% align=center style='position:relative;top:10;left:5'>
<TR>
<TD nowrap>
検索文字列
</TD>
<TD width=10>
</TD>
<TD>
<INPUT type=text name=SearchString style='width:200'>
</TD>
<TD width=10>
</TD>
<TD>
<INPUT
type=button
name=SearchFirst
value="先頭から検索"
style='width:80'
onClick='Call PageSearch()'
>
</TD>
</TR>
<TR>
<TD colspan=4>
</TD>
<TD>
<INPUT
type=button
name=SearchNext
value="次を検索"
style='width:80'
onClick='Call PageSearchNext()'
disabled
>
</TD>
</TR>
<TR>
<TD colspan=4>
<TABLE><TR>
<TD>
<INPUT
type=checkbox
name=SearchOption
style='position:relative;top:-2'
>
</TD>
<TD>
<SPAN onClick='Call document.all("SearchOption").click()'>
大文字と小文字を区別する
</SPAN>
</TD>
</TR></TABLE>
</TD>
<TD>
<INPUT
type=button
name=SearchBack
value="前を検索"
style='width:80'
onClick='Call PageSearchBack()'
disabled
>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
<SCRIPT for=window event=onload language=VBScript>
Set pWindow = window.dialogArguments
Call window.setTimeout("Call document.all.item(""SearchString"").focus()", 50 )
Set BodyTextObj = pWindow.document.all.tags("BODY")(0).createTextRange()
BookMark = BodyTextObj.getBookmark()
</SCRIPT>