How do I change html style dynamically


 
Thread Tools Search this Thread
Top Forums Programming How do I change html style dynamically
# 1  
Old 10-16-2010
How do I change html style dynamically

I've got the following form element in a template driven web page...
Code:
<INPUT type="text" class="normal" id="LastName" name="LastName" value="{LastName}">

The stylesheet description is simply...
Code:
input.normal { width: 250; }

I want to change the background colour of the input box after the user has changed the value, so he knows he's changed it.

How do I do it? I've tried all sorts of things to get the Javascript onChange function just to tell me what the style is at the moment and keep getting nulls returned - I'm sure this is easy for a Javascript/CSS guru!

As a secondary point, if I use a reset button on the form, I understand that this will reset the input boxes to their original values, but would it also reset the style to its original value if I've changed the colour as described above?

P.S. Couldn't post this on the Web Development forum 'cos the site kept telling me it was invalid!Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Merge cells in all rows of a HTML table dynamically.

Hello All, I have visited many pages in Unix.com and could find out one solution for merging the HTML cells in the 1st row. (Unable to post the complete URL as I should not as per website rules). But, however I try, I couldn't achieve this merging to happen for all other rows of HTML... (17 Replies)
Discussion started by: Mounika
17 Replies

2. Red Hat

To change of remote printer font style

How can I change the remote printer font style as its been printing in a non readable format. Is it possible to change it from the server console. (0 Replies)
Discussion started by: gsiva
0 Replies

3. Shell Programming and Scripting

Change the file style to another version with awk

#cat myfile libgcc: Package > additional *crt*.o files for PPC libgcc: Package > additional *crt*.o files for PPC binutils: Default to n64 when configured for mips64 binutils: Default to n64 when configured for mips64 > gcc-4.6, gcc-4.7: Add support for building mips64 cross compi... (3 Replies)
Discussion started by: yanglei_fage
3 Replies

4. Programming

GNUPLOT- how to change the style of data points

Hi, I am trying to arrange my graphs with GNUPLOT. Although it looked like simple at the beginning, I could not figure out an answer for the following: I want to change the style of my data points (not the line, just exact data points) The terminal assigns first + and then x to them but what I... (0 Replies)
Discussion started by: natasha
0 Replies

5. Shell Programming and Scripting

Change Hex character strings to HTML entities

Hi! I am not a whiz at awk and very unsure about the aplication of awk solve my problem. I was hoping for some quick pointers so I can figure this out. I have a file that looks like so: label.Asked=\u8CEA\u554F\u6E08\u307F button.Edit=\u7DE8\u96C6... (3 Replies)
Discussion started by: pinnochio
3 Replies

6. Linux

change the memory address of ld.linux-so in a dynamically linked process

hi, For some special reason , I'd like to control the memory address for the shared libraries in my dynamically linked process. And it is the "ld" which interpret the dynamically linked library, and in my system, the "ld-linux.so.2" is put at 0x00812000. Then I use "prelink -r" command to... (3 Replies)
Discussion started by: zerocool_08
3 Replies

7. UNIX for Dummies Questions & Answers

change the memory address of ld.linux-so in a dynamically linked process

hi, For some special reason , I'd like to control the memory address for the shared libraries in my dynamically linked process. And it is the "ld" which interpret the dynamically linked library, and in my system, the "ld-linux.so.2" is put at 0x00812000. Then I use "prelink -r" command to change... (0 Replies)
Discussion started by: zerocool_08
0 Replies

8. Shell Programming and Scripting

dynamically change awk Field Separator FS

Hi All, I was wondering if anyone knew how to dynamically change the FS in awk to accept vairiable containing a field separator. the current code is as below and does not work when i introduce the dynamic FS change :-( validate_source_file() { source_file=$1 ... (2 Replies)
Discussion started by: satnamx
2 Replies

9. Web Development

Rewrite rules to change “link.html?hl=es” to “/es/link.html” etc?

Hey! Does anyone know how to create rewrite rules to change: “link.html?hl=en” to “/en/link.html” “link.html?hl=jp” to “/jp/link.html” “link.html?hl=es” to “/es/link.html” etc? Where "link.html" changes based on the page request? (2 Replies)
Discussion started by: Neo
2 Replies
Login or Register to Ask a Question