<textarea> content size causing submit buttons to be inactive in XY HTML form

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Dustydog
Posts: 321
Joined: 13 Jun 2016 04:19

Re: <textarea> content size causing submit buttons to be inactive in XY HTML form

Post by Dustydog »

Any particular version of IE? Or the one currently installed on my machine?

And thank you.

And yes, I meant Javascript.

Dustydog
Posts: 321
Joined: 13 Jun 2016 04:19

Re: <textarea> content size causing submit buttons to be inactive in XY HTML form

Post by Dustydog »

Answered my own question using html. XY (at least on Windows 10, and I suspect everywhere) is using IE version 7.

This was useful enough to me that I'm going to put it in another post.


Dustydog
Posts: 321
Joined: 13 Jun 2016 04:19

Re: <textarea> content size causing submit buttons to be inactive in XY HTML form

Post by Dustydog »

Here's what my final solution was:

Since Internet Explorer 7 (which is what XY is compatible with) doesn't support ways of recoloring disabled text (which would have been the easiest way not to submit the data contained in the textarea - it works, but being unreadable, it's pointless), I simply put an html-containing variable before and behind the textarea variable that changes it to displayed text rather than a textarea. I also have to use a regexreplace to change <crlf> to <br> so it displays correctly in the textarea content variable before I display the form.

This works well. And if I do have an over-large textarea that I need to change for the text in the file being shown (which is very useful to me to see), because I added too much text to the edit, I simply cut it to the clipboard and handle it manually after the form submits. The script also selects the file to be edited when it finishes (yes, I could open it, but I prefer it this way) if there was no textarea submitted, or its content was empty. I could have used a checkbox for this and opened it if it was true, but I didn't bother.

I also cut down the variable sizes I use to an absolute minimum size (their names count to the submit limit), and rather than have some pre-selected boxes, I've changed the default behavior so an unselected box is almost as clear - and doesn't get submitted of course. I also cut down 4 sometimes large text boxes to two, though the functionality got somewhat reduced.

I'm now estimating the size of the textarea I can use safely in a conveniently placed variable that, for this form, is currently set at 1200 characters before I change the textarea to view only. This lets me add some text when under that, but not a lot, which is where cutting it all to the clipboard comes in. But, at least my forms submit virtually all the time now, being well under the 2079 character limit that, at least for me, was the top.

(If I enable a debug variable, it shows me the sizes of everything both before and after submitting the form, though I didn't bother to have it calculate the sizes of all the variables if all were submitted, since they never are, along with real and potential default and submit data. It's always a guess before the form is submitted anyway, the textarea size being the most important anyway to determine whether I can have it in a textarea or simply display it. I did make a practical estimate manually, however, before determining my textarea cutoff.)

I wish I knew Javascript better - especially what it's capable of within this version of IE compatibility- so I know what I could get away with inside the form rather than automating everything via XY scripting almost solely.

***

Does anyone know if it would it be possible to have Javascript write the textarea to a file and then delete the content from the form before submission? Since the form seems to have an unlimited display length, and is only limited by the submit length string? And have it compatible with IE 7? (I found some good code to do this, but it takes a more recent browser compatibility.)

Post Reply