User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 375,246 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,147 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting

Java script - wordwrap ?

Join Date: Jul 2005
Location: india
Posts: 143
Reputation: katarey is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 15
katarey's Avatar
katarey katarey is offline Offline
Junior Poster

Help Re: Java script - wordwrap ?

  #4  
Nov 26th, 2006
Hi there,

Actually the JavaScript is there and its working well, but which Attribute you want to add in textfiels that doesn’t support! With this tag (rows="2" cols="40"), you should use the textarea for this functionality,

[HTML]<!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=iso-8859-1" />
<title>Untitled Document</title>
<script language="JavaScript" type="text/javascript">
//<![CDATA[

function get_Result()
{
document.answer.Tim10.value = "Having papers from the registering body "+ "\n" +"that attest to their ancestry. A tracking registry.";
document.answer.Tim10a.value = "Having papers from the registering body "+ "\n" +"that attest to their ancestry. A tracking registry.";
document.answer.Tim10.setAttribute("rows","5");
document.answer.Tim10.setAttribute("cols","40");
document.answer.Tim10a.setAttribute("rows","5");
document.answer.Tim10a.setAttribute("cols","40");
}
//]]>
</script>
</head>
<body>
<p><b>Q10) Breed is not about traits as much as it is about pedigree. Pedigree means?</b><br>
<form action="" method="post" name="answer">
<input type="button" name="submit" value="Answer!" onclick="get_Result();" />
<br />
<textarea name="Tim10"></textarea>
<br />
<input name="Tim10a" type="text"/>
</form>
</p>
</body>
</html>
[/HTML]

Regards,
Rahul Dev
Freelance Web Designer & Developer
Http//www.Katarey.com
Reply With Quote  
All times are GMT -4. The time now is 4:49 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC