0

I want to add an image click event inside the content Editor web part using the JavaScript only. Here is the scenario which i want.

  1. I have 4 images in the main sharepoint page insides the content editor webpart
  2. I have 4 list in the Sharepoint site(Team A, Team b, Team C, Team D).
  3. Each Team in the list will contains 50 Names.
  4. Based on the Current user login, if the user selects first images i need to check weather he belongs to the first list or not. if current user name is the team A list name i need to set alert"congratulatuion" otherwise i need to say u "u have selected the wrong team name"
  5. Based on the Current user login,if the user selects Second images i need to check weather he belongs to the Second list or not. if current user name is the team B list name i need to set alert"congratulatuion" otherwise i need to say u "u have selected the wrong team name"
  6. Based on the Current user login,if the user selects third images i need to check weather he belongs to the third list or not. if current user name is the team c list name i need to set alert"congratulatuion" otherwise i need to say u "u have selected the wrong team name"
  7. Based on the Current user login,if the user selects fourth images i need to check weather he belongs to the fourth list or not. if current user name is the team D list name i need to set alert"congratulatuion" otherwise i need to say u "u have selected the wrong team name".

only using javascript and jquery. No visual studio

3
  • 1
    What exactly is your question? Jun 5, 2014 at 18:11
  • i need to validate based on the current user login i need pop up the message "congratulation" if he selects correct image or "error" inside content editor webpart. if he get congratulation i need put success in one column for his item in the list. Error means i need to put failure for his item in the list.
    – user876869
    Jun 5, 2014 at 18:21
  • hi cuthberston, have u got my point?
    – user876869
    Jun 5, 2014 at 18:25

1 Answer 1

1

You can bind a click event to an image using jQuery in the same way as you would with any other element (though this really isn't a SharePoint question):

jQuery('yourselector').click(function() {
    console.log('Image clicked.');
});

If you're trying to read and compare list data, you should read up on SharePoint's JavaScript Client Side Object Model.

1
  • by selecting the image i have to take the current user login and need to check weather user login name is available in the sharepoint list or not.that is my question.have u got it now?
    – user876869
    Jun 6, 2014 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.