Autor Zpráva
happyguy
Profil
Ahoj, mam problem asi je to blbost ale nevite co je tam spatne v tom scriptu ze ten text v tom poli ze nezmeni na "neco..." ?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form>
<input type="text" id="text" value="" size="25" />
</form>
<script type="text/javascript">
document.form.text.value = "neco..."
</script>
</body>
</html>
DJ Miky
Profil
Radši
document.getElementById("text").value="neco";
peta
Profil
ID ... document.getElementById("text").value
NAME ... document.forms[0].text.value
<form name=aaa>
<input type="text" name="bbb" value="" size="25" />
document.aaa.bbb.value

jakpsatweb - javascript - priklady - formulare - ...
Dedleg
Profil
nie nahodou: form.text.value="neco" ?
cize:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form>
<input type="text" id="text" value="" size="25" />
</form>
<script type="text/javascript">
form.text.value="neco..."
</script>
</body>
</html>

Vaše odpověď

Mohlo by se hodit

Neumíte-li správně určit příčinu chyby, vkládejte odkazy na živé ukázky.
Užíváte-li nějakou cizí knihovnu, ukažte odpovídajícím, kde jste ji vzali.

Užitečné odkazy:

Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0