Jump to content

Apollyein

Members
  • Posts

    3
  • Joined

  • Last visited

Apollyein's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thank you. That's exactly what I was after.I wanted to know how; You did it for me. Thanks.Now I'll get to work decoding it so I know how you did it.Thanks again.~Apollyein
  2. Thanks for the quick reply!Erm...Does that only work when I type it in, or does it also work when it's being searched for in the string?~Apollyein
  3. I want to use CSS, Javascript, and HTML to make a resource for story formatting. That is, making a story appear as though it was taken straight from the bible.I have a text box. I pull the info from the text box, and make it a string. I take said string, find the first letter, <span> it, and then add the rest.My code is basically a copy and paste Frankenstein of W3 and Javascript for the Total Non Programmer tutorials, with hours of tinkering to make it do what I want.My issue:The code ignores all new lines. It just displays as one big text brick.My code is as follows: <HTML><head><style type="text/css">span{float:left;width:0.7em;font-size:400%;font-family:algerian,courier;line-height:80%;}</style><script LANGUAGE="JavaScript"><!-- Beginning of JavaScript -function MsgBox (textstring) {alert (textstring) }function MyWindow(message) { //Define contents of page first=message.slice(0,1) contents= '<html>'+ '<head>'+ '<style type="text/css">'+ 'span'+ '{'+ 'float:left;'+ 'width:1.4em;'+ 'font-size:400%;'+ 'font-family:Celticmd,algerian,courier;'+ 'line-height:80%;'+ '}'+ '</style>'+ '<body bgcolor="white"><br><br><br><br>'+ '<p><span>'+first+'</span> '+ message '</p>'+ '</body>'+ '</HTML>' //Create new Window options = "toolbar=1,status=1,menubar=1,scrollbars=1," + "resizable=1,width=900,height=600"; newwindow=window.open("","FormattedStory", options); newwindow.document.write(contents); newwindow.document.close();}// - End of JavaScript - --></SCRIPT></head><body><center><textarea rows="30" cols="80" id="inputstory">Copy and Paste Your Story Into This Box.</textarea><br><INPUT NAME="submit" TYPE=Button VALUE="Format" onClick="MyWindow(inputstory.value)"></center></HTML Any ideas or help?I'm a total n00b, and the only thing I can think of without requiring a special syntax is to search for a carriage return and splice at that character. Problem is, I don't know how to search for a carriage return!~Apollyein
×
×
  • Create New...