Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Wednesday, October 26th, 2005

Time Event
4:08p
Generic Form Replace
Hello,
I'm working with a terrible product that sees all commas as a new record even though the data is coming from a freaking database and not a CSV file. Because of this, I have to figure out a way to insert commas after the fact. Thing is, I need this to apply to all the forms and thus I'll have no idea of what the form field names will be. Is there an ultra generic way to say

In this form.. if there are ANY instances of || please replace it with ,

So for instance "Bankruptcy|| Finances and Commercial" will turn into "Bankruptcy, Finances and Commercial"

Thanks for any help or suggestions!
8:51p
I need a re-primer
I know this is insanely stupidly simple, and will probably only take about 5 lines of code, but I haven't written in JS soooo long. Essentially, I'm going to use CSS to implement a massive random formatting to a web site - dynamically generating the formatting on every load. Here's what I want in psuedo code:

OnLoad, generate random number randWord five times and store values. For each randWord selected greater than 3 letters long, generate two random numbers randColor and randFormat, relate it to the proper formatting, and apply these to the word. Continue through the entire document until the end is reached.

The range for each randWord value is between 2 and 5, and the possible formatting follows:

Colors - red, dark blue, black, white, dark yellow, and pink
Formats - highlighted, underlined, bold, bigger, and italicised

If it's highlighted, the highlight is in the color of randColor, and the word is either black or white, predefined (depending on what shows up best).

Anyone know of any snippets like this, willing to write it, or hold my hand through it? I won't need to have explained a lot of JS stuff, I'll know it when I see it, but it's just a matter of knowing it - get what I mean? I can't think of the functions off the top of my head, but I do know what they are =)

Thanks so much in advance =P

<< Previous Day 2005/10/26
[Calendar]
Next Day >>
About LiveJournal.com
Image