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

  • Home
  • SEARCH
  • 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 7187949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:57:34+00:00 2026-05-28T18:57:34+00:00

OK, going to try and explain this properly as I think thats why an

  • 0

OK, going to try and explain this properly as I think thats why an answer is escaping me and some users are giving me negative replies as they think I have not tried with research to solve this problem.

I have a page where a user is presented with images within a slide viewer. Each item in the slide viewer is inside a LI element.

When a user chooses a slide, and the form is then submitted, I need the script to update a hidden field so I can take which slide they have chosen into a form. Either by updating onclick or when the form is submitted, it matters not when. The hidden field contains the URL of the image shown at that time.

So, the code I currently have is:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="/js/jquery.easing.1.3.js" type="text/javascript"></script>

<!-- this is the slideviewer code -->
<script src="/js/jquery.slideviewer.1.2.js" type="text/javascript"></script>

<!-- this is what I have been trying to update the hidden field -->
<script type="text/javascript">
$(document).ready(function(){
 $( "#wl_add" ).submit( function ( event ) { /* form name and id = wl_add */
 $('input[name="item_pic_url"]').val($('#mygalthree img').attr('src'));
 } );
});
</script>

<!-- the div containing the slide viewer -->
<div id="mygalthree" class="svw"><ul>
<?PHP

foreach($html->find('img') as $e){ // from simple_html_dom

    $image = $e->src;

    echo '<li><img src="'.$image.'" width=300 alt="" /></li>';

}

// the hidden field to be updated - i am presuming needs to be after the loop which feeds the LI elements
echo '<input type="hidden" name="item_pic_url" value="'.$image.'" />';

?>

</ul></div>

Or, would it be easier to update the hidden field each time a slide is chosen? below you can see the code for the slideviewer – I would have thought I might be able to add

$(‘input[name=”item_pic_url”]’).val($(‘#mygalthree img’).attr(‘src’));

when the user clicks? But I cannot find where to add this either and I have tried nearly every line! Slideviewer code:

    jQuery(function(){
   jQuery("div.svw").prepend("<img src='/images/spinner.gif' class='ldrgif' alt='loading...'/ >"); 
});
var j = 0;
var quantofamo = 0;
jQuery.fn.slideView = function(settings) {
    settings = jQuery.extend({
        easeFunc: "easeInOutExpo",
        easeTime: 750,
        uiBefore: false,
        toolTip: false,
        ttOpacity: 0.9
    }, settings);
    return this.each(function(){
        var container = jQuery(this);
        container.find("img.ldrgif").remove();
        container.removeClass("svw").addClass("stripViewer");       
        var pictWidth = container.find("img").width();
        var pictHeight = container.find("img").height();
        var pictEls = container.find("li").size();
        var stripViewerWidth = pictWidth*pictEls;
        container.find("ul").css("width" , stripViewerWidth);
        container.css("width" , pictWidth);
        container.css("height" , pictHeight);
        container.each(function(i) {
    (!settings.uiBefore) ? jQuery(this).after("<div class='stripTransmitter' id='stripTransmitter" + (j) + "'><ul><\/ul><\/div>") : jQuery(this).before("<div class='stripTransmitter' id='stripTransmitter" + (j) + "'><ul><\/ul><\/div>");            
        jQuery(this).find("li").each(function(n) {
        jQuery("div#stripTransmitter" + j + " ul").append("<li><a title='" + jQuery(this).find("img").attr("alt") + "' href='#'>"+(n+1)+"<\/a><\/li>");                                             
        });
        jQuery("div#stripTransmitter" + j + " a").each(function(z) {
        jQuery(this).bind("click", function(){  
        jQuery(this).addClass("current").parent().parent().find("a").not(jQuery(this)).removeClass("current"); // wow!
        var cnt = -(pictWidth*z);
        container.find("ul").animate({ left: cnt}, settings.easeTime, settings.easeFunc);
        return false;
        });
        });


        container.bind("click", function(e){
            var ui = (!settings.uiBefore) ? jQuery(this).next().find("a.current") : jQuery(this).prev().find("a.current");
            var bTotal = parseFloat(jQuery(this).css('borderLeftWidth').replace("px", "")) +  parseFloat(jQuery(this).css('borderRightWidth').replace("px", ""));
            var dOs = jQuery(this).offset();
            var zeroLeft = (bTotal/2 + pictWidth) - (e.pageX - dOs.left);

            if(zeroLeft >= pictWidth/2) { 
                var uiprev = ui.parent().prev().find("a");  
                (jQuery(uiprev).length != 0)? uiprev.trigger("click") : ui.parent().parent().find("a:last").trigger("click");                           
            } 
            else {
                var uinext = ui.parent().next().find("a");
              (jQuery(uinext).length != 0)? uinext.trigger("click") : ui.parent().parent().find("a:first").trigger("click");
            }
        });


        jQuery("div#stripTransmitter" + j).css("width" , pictWidth);
        jQuery("div#stripTransmitter" + j + " a:first").addClass("current");
        jQuery('body').append('<div class="tooltip" style="display:none;"><\/div>');


        if(settings.toolTip){
        var aref = jQuery("div#stripTransmitter" + j + " a");

        aref.live('mousemove', function(e) {
        var att = jQuery(this).attr('title');
        posX=e.pageX+10;
        posY=e.pageY+10;
        jQuery('.tooltip').html(att).css({'position': 'absolute', 'top': posY+'px', 'left': posX+'px', 'display': 'block', 'opacity': settings.ttOpacity});
        });
        aref.live('mouseout', function() {
        jQuery('.tooltip').hide();
        });             
        }
        });
        j++;
    }); 
};
  • 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-05-28T18:57:36+00:00Added an answer on May 28, 2026 at 6:57 pm

    OK, this has been driving me insane, but it is now solved… In the actual slideviewer code, when a user chooses a number of an image, I added a simple onclick to write the value of the hidden field.

    jQuery("div#stripTransmitter" + j + " ul").append("<li><a title='" + jQuery(this).find("img").attr("alt") + "' href='#' onClick=\"document.wl_add.item_pic_url.value='" + jQuery(this).find("img").attr("src") + "'\" >"+(n+1)+"<\/a><\/li>");
    

    Thanks for suggestions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is going to be hard to explain but I'll try my best. I
Sorry in advance im going to try and explain this as best as possible....
This is a far stretch but i am going to try an explain the
I'm going to try to explain this in simple terms, because it's probably shorter
I'm going to try and explain this the best I can... I have one
I'm not sure how to explain this so I am going to try do
Alright, I'm going to try to explain this as best as possible: I have
Ok, I'm going to try to explain this one as easy as possible! I'm
I'm going to try and explain this without showing any code because I don't
I'm going to try to explain this best I can I will provide more

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.