need some help!

R

rcoco

Hi everyone,
I'm having trouble with a datagrid that is supposed to insert data.
But one row has to insert data in the data base using Radio button. So
I created two buttons one of Bad Mood then the other one is Good mood.
when one is selected, the data is to be inserted into the database.
this is working well. But the problem comes when it comes to images,
thes images are smilies. When good mood is selected I want a smiley to
be inserted into the database too. So I created the smilies but when
and made them invisible so I wrote this code to be able save them in
the database but I'm getting two errors. Where could I be wrong?

document.getElementById("imggm").style.visibility = "hidden";
function ChangeSmile()
{
if (document.getElementById("rblmood_0"))
{
document.getElementById("imggm").style.visibility = "none";
document.getElementById("imggm").src = "laughing.gif";
}
else
{
document.getElementById("imgbm").style.visibility = "visible";
document.getElementById("imgbm").src = "sad.gif";
}
}

The errors are:

Invalid token '(' in class, struct, or interface member declaration
Invalid token '=' in class, struct, or interface member declaration
(This error appears on the line:
document.getElementById("imggm").style.visibility = "hidden";)

Thanks.
 
P

Patrick Steele

Hi everyone,
I'm having trouble with a datagrid that is supposed to insert data.
But one row has to insert data in the data base using Radio button. So
I created two buttons one of Bad Mood then the other one is Good mood.
when one is selected, the data is to be inserted into the database.
this is working well. But the problem comes when it comes to images,
thes images are smilies. When good mood is selected I want a smiley to
be inserted into the database too. So I created the smilies but when
and made them invisible so I wrote this code to be able save them in
the database but I'm getting two errors. Where could I be wrong?

document.getElementById("imggm").style.visibility = "hidden";
function ChangeSmile()
{
if (document.getElementById("rblmood_0"))
{
document.getElementById("imggm").style.visibility = "none";
document.getElementById("imggm").src = "laughing.gif";
}
else
{
document.getElementById("imgbm").style.visibility = "visible";
document.getElementById("imgbm").src = "sad.gif";
}
}

The errors are:

Invalid token '(' in class, struct, or interface member declaration
Invalid token '=' in class, struct, or interface member declaration
(This error appears on the line:
document.getElementById("imggm").style.visibility = "hidden";)

Is "getElementById" a method or an indexer? I wonder if it should be:

document.getElementById["imgbm"].style ....
 
R

rcoco

Thanks Patrick,
What could it be? I have to get a smiley being inserted into sql
database. Do you have an Idea how?
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top