Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Typing errors

Quote Reply
Typing errors
I had a site user add a resource with typing errors in it. I'm not exactly sure, but I suspect he was entering a CONTROL apostrophe instead of a SHIFT quote (he was trying to type out a title with quotes around it). The result was that all of the text entered in that textarea after the error was either lost or invisible.

I discovered code from the Forums that allows hard returns to be recognized by scripts (which I have added to my scripts, thank you very much!). Is there any code available that would trap common typing errors like this (embedded CONTROL characters) and automatically sift them out?

cosmic
Quote Reply
Re: Typing errors In reply to
Try the following codes:

Code:
foreach $column (@db_cols) {
$in{$column} =~ s/`//g;
}

in the sub site_html_add_form and sub site_html_add_failure routine.

BTW: Since this deal with a code hack, you should post questions like this in the Modification Forum.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Typing errors In reply to
Hi Eliot--

I'm going to continue to post here, if that's OK, because I want to discuss the meaning of this code a little bit before using it. If that's not OK, I'm happy to switch to a different Forum (Mod or Perl) to complete the discussion.

From my study of Perl, which I'm obviously just beginning, what I think you're proposing here is a character substitution of nothing for ` (essentially deleting the `) across all of the data coming from the database and going to these particular Web pages (Add a Resource and Error Adding Resource) as built by their corresponding templates (hope I'm right on that--feel free to straighten me out if I'm off base).

Is the backtick (`) the correct character for the key combination of CTRL+' (that's my representation of the user holding down the CONTROL key and simultaneously pressing the apostrophe key)? The reason I ask is because the key combination of CTRL+' seems to produce no visible character, which is the crux of the problem. Most of my users are typing their lengthy entries in a word processor first (for spell and grammar checking and because the info is easier to view for editing) and then copying and pasting into the fields on the form.

Since the user can't see the character, then they don't know it's there. When no character appears on the screen when they type the CTRL+', then the user adds a SHIFT+' (which means that a quotation mark " is produced) and they go on their way thinking everything is OK. OK, of course, until their entry is viewed on the Web page and everything in that field after the hidden CTRL+' character fails to appear. In reality, the hidden CTRL+' character and the " character are both there.

I'm perseverating on this because half of the users to my newly launched Links 2.0 Web site have experienced this problem. Administratively, I can catch these problems and edit them out as I validate, but I'm trying to reduce the adminstrative overhead.

I'm also wondering, by the way, if I should add this code to the subroutines site_html_modify_form and site_html_modify_failure to make sure the same thing isn't happening when the user attempts to modify an exising resource.

Thanks for the help!

cosmic


[This message has been edited by cosmic (edited April 21, 2000).]

[This message has been edited by cosmic (edited April 21, 2000).]
Quote Reply
Re: Typing errors In reply to
Okay...the explanation of the codes I provided is as follows:

if there character is present in any field, then delete the character, thus the // in the codes. If you want the character to be replaced with a space then the slashes would look like / /.

Hope this makes sense...

Thanks for being more clear which character you are referring to...

Although I do not know the correct character output to revise the codes...could you please give us a link to your directory, so that we can see the output.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.