0

ここで厄介な問題。

私のページが読み込まれるとき:<body onload="getClientDateTime();">

次の関数を実行します。document.getElementById('ClientDateTime').value="hello world";

理論的には、「hello world」を隠しフィールドに挿入する必要があります。<INPUT TYPE="hidden" name="ClientDateTime" id="ClientDateTime" value="">

しかし、彼女は働きません。

フィールドを「テキスト」タイプに変更すると、本来のように機能しますが、「非表示」としては機能しません。助けてください!

4

1 に答える 1

2

これは、正しい値を警告するため、実際に機能します。

<html>
<head>
    <title>Test</title>
</head>
<body onload="document.getElementById('ClientDateTime').value='hello world'; alert(document.getElementById('ClientDateTime').value);">

<input type="hidden" name="ClientDateTime" id="ClientDateTime" value="" />

</body>
</html>
于 2009-10-28T19:23:23.553 に答える