EdwardMartinIII
Technical User
Here's a goofy little project. I want a "yes man".
Here's my (way stripped down) JS file:
And here's the HTML page that calls it:
In Mozilla, after you click the button, it places the cursor at the bottom of the text area, which is where I want it (ready to ask the next "burning question", but in IE, it places it at the end of the text line, completely ignoring (it seems) the two extra line returns.
My goal is to have the cursor drop to the bottom of the window -- the end of the string it currently contains.
Any suggestions?
Cheers,
Edward
"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
Here's my (way stripped down) JS file:
Code:
function OhAbsolutely(Argument)
{
var YesString = "Oh, Absolutely!"
Argument += "\n\n" + YesString + "\n\n"
return Argument;
}
And here's the HTML page that calls it:
Code:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta>
<title>JavaScript Sample</title>
<script src="Sample.js" type="text/javascript"></script>
</head>
<body>
<form name="MainForm" action="">
<p>Please start by describing your business issue below</p>
<p>Press <input type="button" value="Respond" id="Analyze" onclick="document.MainForm.Texty.value=OhAbsolutely(document.MainForm.Texty.value);document.MainForm.Texty.focus();return true;"></input> for a response.</p>
<textarea rows="30" cols="50" name="Texty" id="Texty"></textarea>
</form>
</body>
</html>
In Mozilla, after you click the button, it places the cursor at the bottom of the text area, which is where I want it (ready to ask the next "burning question", but in IE, it places it at the end of the text line, completely ignoring (it seems) the two extra line returns.
My goal is to have the cursor drop to the bottom of the window -- the end of the string it currently contains.
Any suggestions?
Cheers,
Edward
"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door