plz help

how to print the cintent of check box to another textarea through the

Page 1 of 1

1 Replies - 231 Views - Last Post: 10 March 2009 - 02:07 PM

#1 pooja14  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-March 09

plz help

Post icon  Posted 10 March 2009 - 01:35 PM

<html>
<head>
<script type="text/javascript">
function createOrder()
{
coffee=document.forms[0].coffee;
txt="";
for (i=0;i<coffee.length;++ i)
  {
  if (coffee[i].checked)
	{
	txt=txt + coffee[i].value + " ";
	}
  }
document.getElementById("order").value="You ordered a coffee with " + txt;
}
</script>
</head>

<body>
<p>How would you like your coffee?</p>
<form>
<input type="checkbox" name="coffee" value="cream">With cream<br />
<input type="checkbox" name="coffee" value="sugar">With sugar<br />
<br />
<input type="button" onclick="createOrder()" value="Send order">
<br /><br />
<input type="text" id="order" size="50">
</form>
</body>

</html>


Is This A Good Question/Topic? 0
  • +

Replies To: plz help

#2 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1147
  • View blog
  • Posts: 7,134
  • Joined: 07-September 06

Re: plz help

Posted 10 March 2009 - 02:07 PM

Please post your code like so:

:code:

Also, what is the issue? Do you have a full question? Any errors? What is the code doing that it isn't supposed to? What isn't the code doing that it's supposed to?

More information will allow us to help you out better.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1