Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8955575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:35:35+00:00 2026-06-15T14:35:35+00:00

I am new to jquery and php, so I apologize if the question is

  • 0

I am new to jquery and php, so I apologize if the question is to simple.
I have to change the image displayed depending on the option selected in the list box.
So far my jquery is able to retrieve and display the desired img id.I intially tried to post the image id back to the php script and then retrieve the image, but later realised I can directly manipulate the img tag(since my images are name 1.jpg,2.jpg).Can someone please help me? Thank you!
Here s the relevant code:

HTML:
<img id="design"  class ="img-rounded" alt="Ad Picture" width="450p" height="450"/>
<input type="button" id="GetImage" class="btn" value="Get Image">
Jquery:
$('#GetImage').live("click",function() {
var imageid= $('#UserIds').val();
$.ajax({
    type:'POST',
    url:'ProvidingFeedback.php',
    data:{id:imageid},
    success: function(msg){ 
       if(result=='success') {
            $('#design').attr('src','/img/2.jpg');

       }
 }
});


});

I

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:35:37+00:00Added an answer on June 15, 2026 at 2:35 pm

    because you are selecting image as id try only img or #design

     $('#img').attr('src','/img/2.jpg');
    

    should be

     $('#design').attr('src','/img/2.jpg');
    

    and

      if(msg=='success') {
    

    should be

      if(msg=='success') {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple jQuery/PHP autocomplete text box that gets the matches from mySQL.
I have upload script here: http://www.saaraan.com/2012/05/ajax-image-upload-with-progressbar-with-jquery-and-php the author does not help me what I
Currently, I have this line: $.post(submitmail.php, $(#contactform).serialize(), recvMailStatus); I'm new to jQuery so this
Am new to jquery. Have json response from php in this format. { div1:{data:minute=0,hour=27,day=649,month=19K,smallSize=0,
I am very new to jQuery and javascript. I have an autocomplete box setup
I am new to jquery and php, I have two input fields, zip and
The question is: How to save user input linebreak to database. (jQuery/php/mysql) I have
I am new to the whole php, sql, jquery. I am trying to paginate
I have application that brings response via Ajax and creates 5-20 new jQuery click
new here and new to jQuery. I've searched for an answer to my question/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.