Topic: Restrict maximum line length input in textarea in realtime Pages that link to <a href="https://ozoneasylum.com/backlink?for=29176" title="Pages that link to Topic: Restrict maximum line length input in textarea in realtime" rel="nofollow" >Topic: Restrict maximum line length input in textarea in realtime\

 
Author Thread
paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

IP logged posted posted 05-02-2007 10:21 Edit Quote

Hi guys

I'm working on a WYSIWYG editor - more like tweaking it and for some reason I need to put in a maximum line length check which goes as such that as the user types in the textarea and lets say during typing he reaches a maximum line length it automatically puts a carriage return and puts him on another line... anyway how to do this guys....

paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

IP logged posted posted 05-02-2007 10:41 Edit Quote

uuuh nevermind .. I just remembered I could use the wrap attribute of the textarea object to do that.. just ignore my rant

subhan
Neurotic (0) Inmate
Newly admitted

From:
Insane since: May 2007

IP logged posted posted 05-07-2007 14:11 Edit Quote

I need to write a code in javascript,which helps me in prompting a username and password before opening the page.This need not store password or username in any database....
Plz help me...
Many Thanks!!
Javid....

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

IP logged posted posted 05-07-2007 16:21 Edit Quote

Welcome to the Asylum, subhan - next time, please open a new topic.

Basic idea here could be to have the input() calls in a <body onload> and then document.write() the rest of the page ( though I bet the standard gusy will run me down on this - and they're right. But a page asking for a username/password in javascript before displaying? come on were so far of the 'good practices' axis that it doesn't even begin to matter).

Now, if you want to secure your site, I suggest you read up on '.htaccess protection' for this is what you'd be usually looking for if you want to protect a site with a username/password that's being asked before the site's show.

So long,

->Tyberius Prime

paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

IP logged posted posted 05-08-2007 15:54 Edit Quote

HELP AGAIN! All of a sudden word wrap is not working on the textarea in my project where I wanted it to work!!!
Is there any way in Javascript that inserts in realtime as you type line breaks when a maximum line length is reached...

HELP!!!!!!!

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

IP logged posted posted 05-08-2007 16:56 Edit Quote

look, you've obviously broken the built in word wrapping and are much better of figuring out how, and restoring it ( don't you have a version contral and can check what you changed?) than to try to assemble a half-baked javascript solution that will basically never work as nice as the built in one ( word wrapping is not simple!)

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 05-10-2007 20:24 Edit Quote

/me stomps Tyberius Prime with a standard stick.


What about, instead of some ugly document.write(), adding the following line to the .htaccess:

code:
php_value auto_prepend_file /system/checkAuthentication.php


The /system/checkAuthentication.php script will check if a cookie is present and either display the requested page or an authentication form posting the data to the same URL and set the cookie.

This way the login/password pairs can be stored directly in the PHP script or in a database. So it's rather safe.

Clean, simple and doesn't mess up with the actual site.



(Edited by poi on 05-10-2007 20:27)

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

IP logged posted posted 05-11-2007 10:24 Edit Quote

But might mess with rowser caching, and relies on (more easily spoofed ) cookies instead of standardized http auth .

Anyhow, the guy asking the question wanted javascript. Your solution does require php, and a properly configured webserver :>


Oh, and I guess if done to simpleton, it will do foul play if the actual site uses something stupid like is_empty($_POST)



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu