html break

Results 1 to 3 of 3

Thread: html break

  1. #1
    Join Date
    Dec 1969

    Default html break

    I am trying to force an HTML Break in a multiline textbox after every 80 spaces. Does any body know the code for this.
    buttsex Webcam
    Last edited by Jay; 04-16-2011 at 01:28 AM.

  2. #2
    Heaven's martini Guest

    Default RE: html break

    Well,<BR><BR>This really isn&#039;t too bad when you think about it.<BR><BR>Its probably inefficient but in vbs when you are processing the data, you could simple grab the left part of the string,<BR><BR>append a "<BR>" and then grab the other part of the string, just do this in a loop. it will take some coding but that is the easiest way, I imagine you could do it in JS on the client, but that could get real sticky real quick.

  3. #3
    Join Date
    Dec 1969

    Default RE: html break

    Breaking after every 80 spaces (I am assuming you mean characters) it quite simple try this:<BR><BR>strLen = Len(myStr)<BR>For x = 80 to strLen Step 80<BR> &#039;assuming that no 19 characters repeat could increase to 25<BR> &#039;that would be about 5 words<BR> tmpStr = Mid(myStr,x-19,19) <BR> myStr = Replace(myStr,tmpStr,tmpStr & vbcrlf)<BR>Next<BR><BR>...html....<BR>&#060;textar ea cols=82&#062;&#060;%=myStr%&#062;&#060;/textarea&#062;<BR><BR><BR>I&#039;d say the trick is preserving words so that you dont break a word on 2 lines. Now we could write code that does this or we could just use wrap=hard in our textarea (&#060;textarea cols=82 wrap=hard&#062;). Know this might not be the perfect answer, I&#039;m not sure if all browser support this or not and writing code can be so much fun so lets try this:<BR><BR><BR>myStrA = split(myStr,chr(32))<BR><BR>uA = Ubound(myStrA)<BR>chrCount = 0<BR>outputStr = ""<BR><BR>For x = 0 to uA<BR>chrCount = chrCount + Len(myStrA(x)) + 1<BR>outputStr = outputStr & myStrA(x) & chr(32)<BR>If x + 1 &#060;= uA Then<BR>If chrCount + Len(myStrA(x+1)) &#062; 80 Then<BR>outputStr = outputStr & "&#124" & vbcrlf<BR>chrCount = 0<BR>End If<BR>End If<BR>Next <BR><BR>....HTML....<BR>&#060;textarea cols=82&#062;&#060;%=outputStr%&#062;&#060;/textarea&#062;<BR><BR>The above code could be clean up alittle but it will get the job done.<BR><BR>Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts