jQuery in Action, 2nd edition*
The moose likes Ranch Office and the fly likes Naming policy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » This Site » Ranch Office
Bookmark "Naming policy" Watch "Naming policy" New topic
Author

Naming policy

Vladan Radovanovic
Ranch Hand

Joined: Mar 20, 2000
Posts: 216
Hello, I visit this forum quite frequently and so often see people not registering acording to naming policy. Instead of posting follow up messages and reminding them to register, wouldn't be easier just to write some client side ( or server side if You prefer) validation using javascript that is going to inforce: User Name (first name, space and last name) ???
Vladan
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20543
    ∞

The software we use is not written by us. It's a commercial package. We have already done many hacks, but that is one that looks pretty dangerous.


permaculture Wood Burning Stoves 2.0 - 4-DVD set
Sean MacLean
author
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
Paul,
I've thought of this too and also I realize that you don't want to hack the software (and the you may be upgrading anyway) but I just looked at the registration source for the html and it seems to me that you could put a simple javascript validation in there that would (at least) act as a first line of defence. I've written such a thing if you want to try it out. Just let me know and I email you the revised page.
Sean
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Sean, if you'll notice, the registration page is actually generated by a perl program. Someone would have to hack the perl program to add the JavaScript to the generated code.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20543
    ∞

Sean,
How much do you know about perl?
Sean MacLean
author
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
I'm fine with Perl. As well, adding a bit more html to the perl code is not a problem - this used to be the meat and potatoes of our web appications. If there's something you want to try, just email me directly and we can see what's up. Just so you know, I'm an application developer for big horkin' web sites .
Sean
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
The problem is that we would be hacking UBB's code so that when an update to the code came along, the hack would be lost.
Sean MacLean
author
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
Well, I've never seen the UUB code but they have to be either reading in a template file that contains the html or they've hard coded the html throughout the Perl. Either way, you simply find the point at which the cgi calls
print "<HEAD>";
print "</HEAD>;
or (if they are using an html template just edit that like regular html).
then between these two lines paste in
< script>
function check()
...
< /script>
Find the form element tag and add the onSubmit bit.
< FORM ACTION=" ..... onSubmit="return check();">
That's it. It would take about 5 minutes. There's no risk as long as you back up the original especially since you're not changing any of the perl code logic - just what it prints to the browser. In the old days our interface guys used to tweak their html directly in the Perl (gulp) which is particularly easy since Perl isn't compiled. Of course, we've developed well beyond the good ol' days now the we develop in Java and VB mostly. Anyway, it's not my place to say what's what with regard to the Ranch...

Sean
I edited this to show the HTML and remove the Javascript error, Carl
[This message has been edited by Carl Trusiak (edited February 05, 2001).]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Naming policy