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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:02:52+00:00 2026-06-04T16:02:52+00:00

Each buttons are updating the element: <input type=text id=field name=image value=<?php echo @$DuzenleSonuc[0][‘image’]; ?>

  • 0

Each buttons are updating the element:

<input type="text" id="field" name="image" value="<?php echo @$DuzenleSonuc[0]['image']; ?>" />

I want to update the elements exactly like that:

  onclick open -> update field
  onclick open1 -> update field1
  onclick open2 -> update field2
  onclick open3 -> update field3
  onclick open4 -> update field4

The situation is now exactly like below. Where am I wrong?

  onclick open -> updates field
  onclick open1 -> updates field
  onclick open2 -> updates field
  onclick open3 -> updates field
  onclick open4 -> updates field

My code is below:

<script type="text/javascript" charset="utf-8">
    $().ready(function() {
        var opt = {// Must change variable name
            url : 'elfinder/connectors/php/connector.php',
            lang : 'tr',
            editorCallback : function(url) {document.getElementById('field').value=url;},// Must change the form field id
            closeOnEditorCallback : true,
            docked : false,
            dialog : { title : 'Dosya Yöneticisi', height: 500 },
        }

        $('#open').click(function() {// Must change the button's id
            $('#finder_browse').elfinder(opt)// Must update the form field id
            $('#finder_browse').elfinder($(this).attr('id')); // Must update the form field id
        })

        $('#open1').click(function() {// Must change the button's id
            $('#finder_browse1').elfinder(opt)// Must update the form field id
            $('#finder_browse1').elfinder($(this).attr('id')); // Must update the form field id
        })
        $('#open2').click(function() {// Must change the button's id
            $('#finder_browse2').elfinder(opt)// Must update the form field id
            $('#finder_browse2').elfinder($(this).attr('id')); // Must update the form field id
        })
        $('#open3').click(function() {// Must change the button's id
            $('#finder_browse3').elfinder(opt)// Must update the form field id
            $('#finder_browse3').elfinder($(this).attr('id')); // Must update the form field id
        })
        $('#open4').click(function() {// Must change the button's id
            $('#finder_browse4').elfinder(opt)// Must update the form field id
            $('#finder_browse4').elfinder($(this).attr('id')); // Must update the form field id
        })
    });
    $(document).ready(function(){
        $('.taslak').click(function(){
            $('#k').val("Taslak");
        });
    })
</script>
<!-- elFinder -->
<div class="textbox left">
    <h2>Ürün Resimleri</h2>

    <div class="textbox_content">
        <p class="fileupload">
            <label>Ürün Ana Resmi:</label>
        <div id="finder_browse"></div>
        <input type="text" id="field" name="image" value="<?php echo @$DuzenleSonuc[0]['image']; ?>" />
        <input type="button" id="open" class="file" value="Resim Seç" />
        </p>
        <hr />
        <p class="fileupload">
            <label>Ürün Resmi:</label>
        <div id="finder_browse1"></div>
        <input type="text" id="field1" name="image1" value="<?php echo @$DuzenleSonuc[0]['image1']; ?>" />
        <input type="button" id="open1" class="file" value="Resim Seç" />
        </p>
        <p class="fileupload">
            <label>Ürün Resmi:</label>
        <div id="finder_browse2"></div>
        <input type="text" id="field2" name="image2" value="<?php echo @$DuzenleSonuc[0]['image2']; ?>" />
        <input type="button" id="open2" class="file" value="Resim Seç" />
        </p>
        <p class="fileupload">
            <label>Ürün Resmi:</label>
        <div id="finder_browse3"></div>
        <input type="text" id="field3" name="image3" value="<?php echo @$DuzenleSonuc[0]['image3']; ?>" />
        <input type="button" id="open3" class="file" value="Resim Seç" />
        </p>
        <p class="fileupload">
            <label>Ürün Resmi:</label>
        <div id="finder_browse4"></div>
        <input type="text" id="field4" name="image4" value="<?php echo @$DuzenleSonuc[0]['image4']; ?>" />
        <input type="button" id="open4" class="file" value="Resim Seç" />
        </p>
    </div>
</div> 
  • 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-04T16:02:53+00:00Added an answer on June 4, 2026 at 4:02 pm

    add the same class to all your button and add just one click event something like:

    $('.btnClass').click(function(){
    var btnID = $(this).attr('id'); // Btn id clicked
    // Process ckick event
    });
    

    or if all button have the starting id open you can make a click event like

    $('input[id^=open]').click(function(){    var btnID = $(this).attr('id'); // Btn id clicked});
    

    add after your comment
    once you get the btnID you can find which finder-browse to use somethign like:

    var $browser;
    switch(btID)
    {
    case 'open':
    $browser = $('#finder_browse');
    break;case 'open1':
    $browser = $('#finder_browse1');
    break;
    

    etc..
    }

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

Sidebar

Related Questions

I've got a series of buttons that each use a different image. Can I
I have a PHP script which is generating buttons to each content schedule. The
I have two radio buttons each with a unique ID. When one is clicked,
I have ten buttons that each correspond to a different number. I'm looking to
Background: I have an Activity that comprises four buttons that each take up a
I've made a small program which has 2 buttons and each does certain thing.
I have two radio buttons next to each other, and even though each one
I have few buttons of which each button is assigned a class with a
I have two buttons in my flex app next to each other, ButtonA and
Suppose I have 3 radio buttons with different values for each radio button and

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.