• Page 1 of 1
  • 1
Locked
Ok
Email form change of colour
coatham
Posts: 248
Reputation: 9

Message # 1 | 3:48 PM
is it possible to have a form a red colour in the background and a green colour when the form has been sent?
Need More In Depth Help About a topic post it here: Click Here
Pancake_old
Posts: 731
Reputation: 8

Message # 2 | 4:31 PM
Yes and no...you can change it to any color you want if you customise it
but i dont know about changing it from the ucoz site

Step 1: Add the below script to the <HEAD> section of your page:

Code
<script language="JavaScript1.2">

var highlightcolor="lightyellow"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}

</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

Step 2: With the above script is installed, all that's left in adding a simple onClick event handler into the <FORM> tag in question. For example:

Code
<FORM onKeyUp="highlight(event)" onClick="highlight(event)">
"
"
</FORM>
1
2

The effect can be added to more than one form on the same page. Enjoy!


ePal(Join and be rewarded with our new look)
Bookface
K-Love (Listen Live)
coatham
Posts: 248
Reputation: 9

Message # 3 | 4:39 PM
Thanks,
Need More In Depth Help About a topic post it here: Click Here
Ok
  • Page 1 of 1
  • 1
Search:
This site uses cookies for better user experience. By continuing to browse the site you agree to the Cookie Policy.