2010-05-31 41 views

回答

1

By,AJAX我假設你的意思是JavaScript。

嗯,你可以使用這樣的事情:

<html> 
<head> 
<title>Form Example</title> 

<script type="text/javascript"> 
window.onload = function() 
{ 
    document.myform.mytext.value = "TEXTBOX"; 
} 
</script> 

</head> 
<body> 

<form name="myform" method="get"> 
<input type="text" name="mytext" /> 
</form> 

</body> 
</html> 

說明:

一旦文檔已完成加載腳本查找名爲 「myForm會」 的形式。然後它會在此表單中查找名爲「mytext」的元素,然後您可以設置/更改value屬性的值。

+0

謝謝你,它運作良好。 – kawtousse 2010-06-01 09:05:06