Jump to content

Need Some Help Again.. :p


ckrudelux
 Share

Recommended Posts

Okay I have this function which checks some stuff in a textarea. This should happen then I press submit.I tested to add a submit line to the function but no luck.

<a class="plink" title="Lägg till en paragraph" href="" onclick="checktags(); return false;">Lägg till paragraf</a>

function checktags(){			if(document.getElementById(b).style.backgroundImage == "url(pageparts/bt.png)"){				document.getElementById('2052420').value += "[/b]";				document.getElementById(b).style.backgroundImage = "url(pageparts/bf.png)";			}			if(document.getElementById(u).style.backgroundImage == "url(pageparts/ut.png)"){				document.getElementById('2052420').value += "[/u]";				document.getElementById(u).style.backgroundImage = "url(pageparts/uf.png)";			}			if(document.getElementById(u).style.backgroundImage == "url(pageparts/ut.png)"){				document.getElementById('2052420').value += "[/u]";				document.getElementById(u).style.backgroundImage = "url(pageparts/uf.png)";			}			if(document.getElementById(l).style.backgroundImage == "url(pageparts/lt.png)"){				document.getElementById('2052420').value += "[/l]";				document.getElementById(l).style.backgroundImage = "url(pageparts/lf.png)";			}			if(document.getElementById(c).style.backgroundImage == "url(pageparts/ct.png)"){				document.getElementById('2052420').value += "[/c]";				document.getElementById(c).style.backgroundImage = "url(pageparts/cf.png)";			}			if(document.getElementById(r).style.backgroundImage == "url(pageparts/rt.png)"){				document.getElementById('2052420').value += "[/r]";				document.getElementById(r).style.backgroundImage = "url(pageparts/rf.png)";			}						document.getElementById('pform').submit();					}

What is wrong ?

Link to comment
Share on other sites

The style.backgroundImage property is empty because the element itself doesn't have a style attribute.
Say what.. I don't have a problem with what.. I was just wondering if my code for submiting the form in the function how I make it to work!?
Link to comment
Share on other sites

Form... Hmm, the code for submitting the form is correct. Does the 'pform' object exist? And does it have any onsubmit handler that's stopping it from being submit?
Yes it does onsubmit no.. Well I thought seens I got the link sending the submit at the beginning I thought I could send it to a function instead and submiting from there.
Link to comment
Share on other sites

Okay I found 1 problem I had forgot to add " " for getElementById("u") instead of getElementById(u) but I can still not submit.Edit: Okat it works know but I don't get it why it takes so many reloads before it takes the new code ?

Edited by ckrudelux
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...