...

View Full Version : Pretty input boxes



theMaster
05-16-2008, 05:20 PM
How do I add a text input box like we have on this site to sites that I create.

It's for the site administrator to make changes to certain text held in a MySQL database - currently it's just the pig-ugly standard text input, but the 'message input' for this site looks really 'pretty'. How can I do it?

FWDrew
05-16-2008, 05:37 PM
How do I add a text input box like we have on this site to sites that I create.

It's for the site administrator to make changes to certain text held in a MySQL database - currently it's just the pig-ugly standard text input, but the 'message input' for this site looks really 'pretty'. How can I do it?
Style it how you like using CSS...



input {
background-color:#CCCCCC; /*Maybe a BG color to match your layout*/
border:1px solid #36393D; /*And a border for good luck */
}

You can really style it however you want, above was just an example.

Drew

_Aerospace_Eng_
05-16-2008, 06:27 PM
Actually I think they want some sort of WYSIWYG editor. I use the one found here: http://www.dynamicdrive.com/dynamicindex16/openwysiwyg/index.htm

There is also http://www.fckeditor.net/ but I think its a little overkill.

jcdevelopment
05-16-2008, 06:27 PM
Are you wanting the look of changing text, styles, colors and spell check? Is that the kind you want?

EDIT*eh, aero got there first

theMaster
05-17-2008, 01:38 PM
Thanks.

A simple question - do these all use some JavaScript? Isn't that a bit bad?

jcdevelopment
05-17-2008, 02:14 PM
Well of course there is going to be a bit of JS when creating an application of a WYSIWYG. The only bad thing is that if the client has thier JS turned off. Then it wont work.

theMaster
05-18-2008, 05:43 PM
So, is it OK to use JS on a site you write? I always thought that any coding should be server side and not client

theMaster
05-18-2008, 05:45 PM
????????????????????

VIPStephan
05-18-2008, 06:02 PM
There’s a reason why JavaScript exists. And it’s useful, especially if used wisely. Wise usage can be described as JS being used to enhance functionality on a site. JavaScript is best used with the principle of progressive enhancement (http://en.wikipedia.org/wiki/Progressive_Enhancement) in mind, i.e. you get the basic functionality of the site working without any styles/enahancements and then you add CSS and JS to enhance the page. But the page itself has to work without those and not rely on the enhancements to work.

Most WYSIWYG editors or other enhancements don’t follow these principles unfortunately. One of the latest developments that do follow them are the JavaScipt effects libraries such as mootools (http://mootools.net/) or prototype (http://prototypejs.org/).

theMaster
05-18-2008, 08:08 PM
But, how can I put http://www.dynamicdrive.com/dynamici...iwyg/index.htm
in and not loose non-JS users?

VIPStephan
05-18-2008, 08:23 PM
If you’re talking about the editor Aero was suggesting: That one is completely accessible to users without JS. The basic functionality – put in text – is there. JS is only used to enhance that text style wise by applying additional HTML or CSS after submitting. Users that don’t have JS could probably do that by typing the HTML/CSS manually.

If you want a completely accessible solution you’d have to do it with server side scripts, though, and it would require a page reload everytime you click a button. That’s what JS is enhancing. And you’d probably have to get a custom application as that DynamicDrive (as most open source scripts) is too generic.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum