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 7129245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:13:21+00:00 2026-05-28T11:13:21+00:00

I have script which allows the user to choose an image and write something

  • 0

I have script which allows the user to choose an image and write something about it…they choose the image from a JQuery slideviewer.

Now, choosing the image is easy..but how can I take the chosen image with the other form data? Each image is currently in a LI element

Code snippet:

<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>
<script src="/js/jquery.slideviewer.1.2.js" type="text/javascript"></script>

UPDATE I have now added this as suggested below but still not working:

<script type="text/javascript">
$( "#wl_add" ).submit( function ( event ) {

$( this ).find( "input[name='item_pic_url']" )
.val( $( "#mygalthree img" ).attr( 'src' ) );

} );
</script>

<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>';
echo '<input type="hidden" name="item_pic_url" value="'.$image.'" />';

?>

</ul></div>

The hidden field in there now currently stores the last image added to the UL

Is there someoway to make a hidden field dynamic and then be changed depending on the image chosen – ideally i need the img src in the hidden field

  • 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-28T11:13:21+00:00Added an answer on May 28, 2026 at 11:13 am
    1. Add another hidden field, current_item_url or whatever you want to call it.

    2. Add a submit listener for the form.

    3. In the submit listener, copy the src of the current image to the hidden field.

    E.g. something like:

    $( "#whatever-form" ).submit( function ( event ) {
    
      $( this ).find( "input[name='current_item_url']" )
        .val( $( "#mygalthree img" ).attr( 'src' ) );
    
    } );
    

    Alternatively, if the slideviewer fires an event or provides a callback you can hook into, you could update the value of the hidden field when the slide changes if you want.

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

Sidebar

Related Questions

I currently have a script which allows me to output the list of files
I have a script which creates a user-defined object like this: obj = new
i have my code(html/javascript) here which allows user to input the size and color
I have a PHP web application running on IIS, which allows a user to
I have a file download script that I have written, which reads files from
I am currently trying to program a batch script which allows the user to
I have this code which allows the user to update their fb status on
I have this script that I found which allows me to have userside Ajax
I have a script which allows to display Google suggestions: JsFiddle I want to
I have a php page which allows a user to sort pieces of information

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.