quick question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Other (
https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (
https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: quick question (
/showthread.php?tid=265839)
quick question -
DirtyLilFreak - 02.07.2011
I have a textfield
Код HTML:
<input type="text" name="example" id="exmaple_test" title="Loremipsum text" placeholder="Lorem Ipsum" autofocus />
Now I want to do this:
Onclick I want it to add a particular text like when I click on the textarea I want the text to turn the value of the textarea to 'Yay'. Any idea how I can do this? I tried ****** but no luck. :/
Re: quick question -
saiberfun - 03.07.2011
that would be a javascript function I'll give it a try
PHP код:
<!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>
<script type="text/javascript">
function change() {
document.getElementById("example_test").value = "Yay";
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
</head>
<body>
<input type="text" name="example" id="example_test" title="Loremipsum text" placeholder="Lorem Ipsum" onclick="change()" autofocus />
</body>
</html>
works for me