webbrowser - Forum

Forum Navigation
You need to log in to create posts and topics.

webbrowser

hello

I use (Browserloadfromstr) to display and print a form or text with variables in a web browser.
Part of the text is inside textArea and it is multi-line.
When I use <br> in textarea, it does not start from the next line and is seen as text (<br>)
Is there a solution to this problem in html?

@s7shanbe

When I use <br> in textarea, it does not start from the next line and is seen as text (<br>)
Is there a solution to this problem in html?

The text inside a TextArea is not HTML; try using \n or \r\n instead of <br/>

luishp has reacted to this post.
luishp

@gaev

Thanks but the problem was not solved
Is there no other solution?

@s7shanbe you need to replace any <br> with \n before sending the text to a TextArea. That's the only solution as TextArea's do not render HTML but plain text.
Regards.

@luishp @gaev

Hello
I want the textarea size to change automatically. I use the following code:

<textarea class="ws16" name="matn" style="text-align: justify; border: none;width: 100%; overflow-x: hidden; overflow-y: hidden; resize: vertical" autofocus="autofocus">
[matn]
</textarea>
<script>
const textarea = document.querySelector("textarea");
textarea.addEventListener("keyup", e =>{
textarea.style.height = "63px";
let scHeight = e.target.scrollHeight;
textarea.style.height = `${scHeight}px`;
});
</script>

 

but this code does not work in Internet Explorer, it works properly in other browsers such as Firefox and google chrom.
How do I fix this problem in Internet Explorer?

@s7shanbe you are using ES6 syntax (too modern for Internet Explorer). This will work:

<textarea class="ws16" name="matn" style="text-align: justify; border: none;width: 100%; overflow-x: hidden; overflow-y: hidden; resize: vertical" autofocus="autofocus">
[matn]
</textarea>
<script>
const textarea = document.querySelector("textarea");
textarea.addEventListener("keyup", function(e){
textarea.style.height = "63px";
scHeight = e.target.scrollHeight;
textarea.style.height = scHeight+"px";
});
</script>

Regards.

@luishp

Does not work in Internet Explorer 10 !

 

@s7shanbe I have tested it in Internet Explorer 11 and it works fine.
I can't test on Internet Explorer 10 and you don't share any error information so it's quite difficult to help you.

Sorry.

@luishp

Thanks

Look at the pictures below

Uploaded files:
  • You need to login to have access to uploads.

s7shanbe it does work on IE11.
Sorry I have no way to test it on IE10.

Regards.

@luishp
Does IE 11 work on operating systems higher than Windows 7?

Internet Explorer 11 only Install on Windows 7

this is work:

<style>
.autoheight {
    min-height: 16px;
    font-size: 16px;
    margin: 0;
    padding: 10px;
    font-family: Arial;
    line-height: 16px;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    overflow: hidden;
    resize: none;
    border: 1px solid #ccc;
    outline: none;
    width: 200px;
}
</style>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
$(document).on('blur','.autoheight',function(e) {
    var $this = $(this);
    // The text is here. Do whatever you want with it.
    console.log($this.html());
});

</script>
<div class="autoheight contenteditable" contenteditable="true">Mickey <b>Mouse</b></div>

 

luishp has reacted to this post.
luishp

Internet Explorer 11 only Install on Windows 7

@s7shanbe although Microsoft is removing Internet Explorer 11 from Windows 11 (and probably form Windows 10 too), its rendering engine will continue as a part of the OS for many years to come. VisualNEO Win doesn't use directly IE11, but the its rendering engine.
Windows 7 and older Windows versions don't have Microsoft support anymore and using them is discouraged due to security reasons.

Regards.

<textarea rows="5" name="S1" cols="20">
line one
line two

line three
line four
</textarea>

You do not need to use <BR> in a form's textarea.  Just leave a blank space (as shown above) and you are done! What do you expect the < BR > to do? In textarea you can only create a line break, not a new paragraph. So < BR > is of no use anyway...)

If you have a long string of text that you want to show as one clickable row in your form's textarea, you don't need to add < BR > at all, because it will word wrap for you automatically to display the entire string as one clickable row (with its appropriate line breaks)

Quote from fkapnist on January 3, 2022, 5:29 am

If you have a long string of text that you want to show as one clickable row in your form's textarea, you don't need to add < BR > at all, because it will word wrap for you automatically to display the entire string as one clickable row (with its appropriate line breaks)

 

Uploaded files:
  • You need to login to have access to uploads.

For a Quick and Dirty way to change your textarea size :

I would run a second (Browserloadfromstr) action... exactly the same as the first  -- except with a different textarea size...  (I think that may be easier than trying to make the outdated Internet Explorer browser recognize your new code!)