...

View Full Version : Newbie needs help for peace of mind



Palomares
09-15-2005, 04:46 PM
Hi there newbie here:

Here's my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>

</head>

<body>
<form name="form1" method="post" action="">
<p>
<input type="text" name="raultext">
</p>
<p>
<input name="submit" type="submit" id="submit" value="1" onClick="EscribeDigito('1')">
</p>
</form>
</body>
</html>


Quite boring yes?? well here goes my question,

I'd like to be able to click the number 1 button and make it appear in the text field. COuld anybody please point me in the right direction?

Thanks!

rm-f
09-15-2005, 04:58 PM
<input type="text" id="raultext">


<input
name="submit"
type="submit"
id="submit"
value="1"
onClick="docuemnt.getElementById('raultext').value='1'; return false;"
>

Pyth007
09-15-2005, 05:13 PM
... or to go along with that...
onClick="docuemnt.getElementById('raultext').value=document.getElementById('submit').value;return false;"
(note the return false at the end just prevents the form from being submitted.)

...if you meant the image of the button, then the answer is no. The only workaround for that would be to create a <div> and use DOM to "move" the button into the div



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum