You are invited to Log in or Register a free Frihost Account!

I could really use some help with Javascript...

I recently had this really awesome idea. I decided that on one of my websites, I would teach a summary of a basic CSS file, and how to make a generic style sheet. After dumbing it down a few notches, I eventually decided it would be the next best thing to create a Javascript to produce one for them. It seemed simple enough, and I thought that I was running along quite smoothly, using this sweet book on Javascript, in addition to my awesome book on HTML/CSS.

Now, it seems like it shouldn't be so hard, since I'm just creating a few forms that people could fill in the values, then have a button that combines the textbox values into seperate threads, and then have a textarea at the bottom that the button will fill in by combining the thread variables. From there, the user could simply copy the completed data, paste it into a text editor, and save as a .css file.

Okay, so now I got the values all transformed into threads just fine. But when it comes to actually combining the threads into the finalized code, I've officially hit a major stump. I have practiced combining textbox values into one textarea countless times now, each try a success. But if you know anything about CSS, the syntax consists of:


body                                        {
                                               background-color: rgb(255,255,255);
                                               background-repeat: repeat-x;

Now, the conflict with javascript is quite clear. So, I want to use something like this:


<button class="btn" onclick="
clr = document.form1.color.value
crs = document.form2.cursor.value

document.form10.finalbox.value = 'body   {' + clr + crs + '}'

">Create code</button>

Now, I know I need special characters so that the curly brackets don't mess up the script, but all the possible ways I find to try don't do squat.

HELP!!! Pray
Stubru Freak
Backslash them?

\{ and \}
Stubru Freak wrote:
Backslash them?

\{ and \}

Thanks, I'll give it a shot Smile.
Related topics
Javascript Gallery Help (get some FRIH$)
Help needed with Javascript and overflow
JavaScript Help
#Paying 30 + frih$ to fix my javascript! Help! Fast!#
HELP with Javascript!
Help with Javascript Aquarium
Help please - menu delay (JavaScript)
Need Help: Javascript stoped until all pages loaded.
Help with javascript!!
A little Help (Html,CSS, javascript)
Javascript help
Thumbnails Linked to jpgs in the Same window. JS or Html?
Off-Screen Objects Javascript
Table Help / Javascript dopdown menu
Reply to topic    Frihost Forum Index -> Scripting -> Others

© 2005-2011 Frihost, forums powered by phpBB.