Click to See Complete Forum and Search --> : function for onsubmit or onclick


florida
02-26-2003, 12:09 PM
Anyway to put in a newline or something to stop my output from creating a long unwrapped line? I want to make some function onsubmit where it forces a newline character after 10 characters. I seem to have a problem with my input form where it doesnt wrap after I enter the data and long sentences force my output box to look like a rectangle.



Here is what is happening:

Long sentence keeps going and going where it extends my output box too long.

I need it to wrap in my output such as:

Long sentence keeps going and going
where it extends my output box too long.


Here is my html form part where I need to use a form input for my entry:

<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=3>
<form action="mypage.html" method=post>
<TR>
<TD>
<TH>Heading</TH>
<TD><input name="heading" type="text" size=30></TD>
</TR>
</form>
</table>

Would it be?:
function forcenewline()
{
//if wordcount > 10
{
"/n"
}
}


I cant use <textarea> in this calendar script so please advise on how I could make a function to work on the onsubmit or onclick event.

Zach Elfers
02-26-2003, 12:51 PM
You can't have a line break in <input type="text">. You must use a textarea.

florida
02-26-2003, 01:32 PM
If I get rid of the type = "text" such as:
<input name="heading" size=30>

Could I now put in a function to get this to work?

For my html page I can not use <textarea> because it doesnt work well with this calendar script I am using.

Any other suggestions?

dabush
02-26-2003, 05:57 PM
Originally posted by florida
If I get rid of the type = "text" such as:
<input name="heading" size=30>

Could I now put in a function to get this to work?

NO. its the same thing. if you dont specify type, the default is type=text

Originally posted by florida
For my html page I can not use <textarea> because it doesnt work well with this calendar script I am using

Ummm. why not?

florida
02-28-2003, 02:52 PM
Cant use <textarea> because this is part of a calendar page and the textarea wrap seems to cut off other data.