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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:39:26+00:00 2026-05-23T11:39:26+00:00

i have this jsfiddle http://jsfiddle.net/DgauY/1/ which adds two items when the element is dropped

  • 0

i have this jsfiddle
http://jsfiddle.net/DgauY/1/
which adds two items when the element is dropped in the Content area. One a X element to remove the dropped element and the other Properties Link. What i want to achieve is to open different dialog forms on clicking on the respective Properties link which has a class based on the element which it contains.
like i i dropped a text box then looking at the properties class which is txtbox when i click on the properties i should have a dialog form which contains options related to text box like label etc…
i hope i am not confusing…

  • 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-23T11:39:27+00:00Added an answer on May 23, 2026 at 11:39 am

    It’s very hard to figure out what you’re asking. It sounds as though you’re asking how to respond to clicks on different “properties” links with different classes by opening different dialog boxes. That would be trivial: Just hook the click event on the relevant “properties” links using bind (click), delegate, or live:

    $("a.type1").click(function() {
        // Open the dialog for type1
        // ...
    
        // Prevent the default action of the link
        return false;
    });
    $("a.type2").click(function() {
        // Open the dialog for type2
        // ...
    
        // Prevent the default action of the link
    });
    

    (And again, you might use delegate or live rather than binding the event on the elements themselves, if this is dynamic at all.)

    Or if you want to use a common handler for all the types and branch within the handler, you could do that:

    $("a.type1, a.type2, a.type3").click(function() {
        // ...code all of them have in common...
        // ...
    
        // Branch on what class(es) the link has and open the relevant dialog
        // ...
    
        // ...more code all of them have in common...
        // ...
    
        // Prevent the default action of the link
        return false;
    });
    

    You can use multiple classes (so each link has both “props” and “type1” or “type2”, etc.)

    If you mean that the links won’t actually have different types, but you want to branch on what’s in the same container they are or something, you can use closest to go up to the container you want, then find and/or children to find out what’s in the container:

    $("a.props").click(function() {
        var container = $(this).closest('div'); // If the container is a div
        if (container.find("textarea")[0]) {
            // It has at least one text area, show dialog...
        }
        else if (container.find("input[type=text]")[0]) {
            // It has at least one text input, show dialog...
        }
        else if (container.find("input[type=button]")[0]) {
            // It has at least one `input`-style button, show dialog...
        }
        // else etc.
    
        // Prevent the default action of the link
        return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: http://jsfiddle.net/5RbrL/ As you can see, the text doesn't go over
i have this setup: http://jsfiddle.net/patrioticcow/XnnvD/ what i want to accomplish is when i hover
I have this setup: http://jsfiddle.net/patrioticcow/yJPGa/5/ I can't figure out how how to toggle in
I have this small script: http://jsfiddle.net/gmAjC/ <input name=n1 value=test> <br/><span></span> <br/> <span style=background-color:red>after input</span>
I have this fiddle here: http://jsfiddle.net/maniator/MUa7P/ In this example a user picks a certain
i have this script found here http://jsfiddle.net/g4txt/ i am using this carousel http://www.thomaslanciaux.pro/jquery/jquery_carousel.htm the
I have this code in jQuery, that I want to reimplement with the prototype
I have this idea for a free backup application. The largest problem I need
I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM
I have this line in a javascript block in a page: res = foo('<%=

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.