Textarea spellcheck

I can’t turn off textarea spellcheck

A textarea can be created in Oxygene as follows (only Chrome tested so far):
var el := Browser.GetElementById(‘DivTxt’);
txtNA.name := “NameAdr”;
txtNA := Browser.CreateElement(‘textarea’);
txtNA.style := "position: absolute; "
+ "top, left, width, height, font-size, etc” //works w/ normal entries
+ “font-family: ‘Arial’, ‘sans-serif’;” //works
+ "wrap: hard; " //works: inserts LF ($0A)
+ "spellcheck: false; " //DOES NOTHING!!!
+ "overflow: hidden; " //works: No Scroll Bar
+ "outline: none; " //works
+ "border: none; " //works
+ "resize: none; "; //works
el.appendChild(txtNA);

spellcheck: I’ve tried “false” & several other things, but the text area red underlines words (e.g. names, common abbreviations, etc) it does not recognize. Yucky!

wrap: I’ve only tested with Water/Oxygene which uses Chrome. The textarea text (txtNA.value) contains $0A (linefeed), but not ($0D) (carriage return). Does anyone know if the other browsers do the same or do they insert $0D$0A or some other code?

That should be between your HTML and the browser, regardless of how the text area was created, no?

I don’t know but setting the other attributes works. I can solve the problem by creating the textarea with HTML/CSS & assume WASM can get it by ID, but prefer to do all in WASM. Seems strange WASM/Oxygene can set all the other attributes, including such as “placeholder”, but NOT spellcheck? So far, I’ve been able to do nearly all but a tiny amount in WASM with my html file containing very little.

<textarea spellcheck="false"></textarea>

The issue is that spellcheck is an attribute, not a CSS property, so setting it via style won’t have any effect.

1 Like

Yea, 1st I tried:
txtNA.spellcheck := “false”; //which did not work, while
txtNA.placeholder := “bunch of text”; //DOES WORK

tried in various ways, e.g. w/o quotes
txtNA.spellcheck := false;

Seems like it ought to work as above or within the style, but can find no way for it to work. BTW, web sez “wrap” is also an attribute, but it works in style.

WASM WORKS!!!
I had to set spellcheck on the textarea element w/o " around false, and Not in Style
txtNA.spellcheck := false; //WORKS

2 Likes

Ah, that makes sense; one one the downsides of an untyped API such as the JavaScript-based DOM model is that the compiler cant enforce the types or properties (because it doesn’t know them. :(.

Glad you got it worked out!

—marc

I hate HTML/CSS/JS & would like to hang whoever replaced Java Applets with that kludge. 3 different languages with different syntax & putting things in different places. Were it a style thingy it would be “spellcheck: false;” rather than = false. Different comments delimiters, different case sensitivity, just plain different. Gotta keep the social justice warriors happy I guess cuz there is plenty of diversity in HTML/CSS/JS.
–Love you guys & WASM!

1 Like

I hear ya :wink:

Thanx! :pray:t3: