コメント |
http://msdn.microsoft.com/library/ja/script56/html/js56jsobjstring.asp?frame=true(文字列オブジェクト)
@DIV
<SCRIPT language="javascript" type="text/javascript">
// *********************************************************
// フォームのチェック
// *********************************************************
function CheckData() {
var str = document.getElementsByName("title")[0].value;
var obj = document.getElementsByName("title")[0];
if ( Trim(str) == "" ) {
alert( "タイトルを入力して下さい " );
return false;
}
if ( str.http://msdn.microsoft.com/ja-jp/library/cc409944.aspx|(indexOf)( '@' ) != -1 ) {
alert( "正しい文字を入力して下さい " );
obj.http://msdn.microsoft.com/ja-jp/library/cc428059.aspx|(focus)();
obj.http://msdn.microsoft.com/ja-jp/library/cc428165.aspx|(select)();
return false;
}
return true;
}
function Trim( strValue ) {
// 以下[]内の空白に見えるのは漢字スペース
var regL = /^[ \s]+/;
var regR = /[ \s]+$/;
strValue = strValue.http://msdn.microsoft.com/library/ja/script56/html/js56jsmthreplace.asp?frame=true|(replace)(regL,"");
strValue = strValue.replace(regR,"");
return strValue;
}
@END
|