Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. Please help!

Please help!

Scheduled Pinned Locked Moved Web Development
helpdatabasequestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nclauder
    wrote on last edited by
    #1

    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.

    K H 2 Replies Last reply
    0
    • N nclauder

      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.

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      Your image buttons if the are server controls get different names in the html. So if you are planning on accessing them you need to know what the ClientID is. I just wrote an article that uses javascript to try the enter key press. You can look at that article on how to pass in a controls ClientId so javascript knows how to find it. http://www.codeproject.com/useritems/EnterKeyToButtonClick.asp[^] Hope that helps. Ben

      R 1 Reply Last reply
      0
      • K kubben

        Your image buttons if the are server controls get different names in the html. So if you are planning on accessing them you need to know what the ClientID is. I just wrote an article that uses javascript to try the enter key press. You can look at that article on how to pass in a controls ClientId so javascript knows how to find it. http://www.codeproject.com/useritems/EnterKeyToButtonClick.asp[^] Hope that helps. Ben

        R Offline
        R Offline
        rockx
        wrote on last edited by
        #3

        that helps a lot.

        ----------------------------- 1.99 $ for a million email addresses - the cheapest price in the world. Check http://luvit.bravehost.com/ for detail

        1 Reply Last reply
        0
        • N nclauder

          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.

          H Offline
          H Offline
          Harini N K
          wrote on last edited by
          #4

          Hi I think you made some mistake as you have two image IDs 'imggm' and 'imgbm'. Make sure all ids are correct.

          Harini

          N 1 Reply Last reply
          0
          • H Harini N K

            Hi I think you made some mistake as you have two image IDs 'imggm' and 'imgbm'. Make sure all ids are correct.

            Harini

            N Offline
            N Offline
            nclauder
            wrote on last edited by
            #5

            Hi harini, Thanks But it's they are all right. Thanks

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups