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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:32:44+00:00 2026-05-11T18:32:44+00:00

With the help of this community, I’ve been able to pass a static chunk

  • 0

With the help of this community, I’ve been able to pass a static chunk of text from javascript (clientside) to ASP 3.5 (server side)! This piece of code works beautifully:

$('.drop').droppable({
    tolerance: "touch", // Here should be a string
    drop: function() {

    $('[id$="myHidden"]').val('Testy test test');
    __doPostBack('<%= HiddenButton.UniqueID  %>', '');
    alert($('[id$="myHidden"]').val());

    }


});

What the above does, is when an element with the class of .drop is dropped, it will assign the string “Testy test test” to my hidden field on my aspx page. Then it does a postback to an invisible button I have that is within an updatepanel. The hidden button’s click event fires, which throws up a msgbox displaying the contents of the hidden element, which invariably are “Testy test test”.

Now here is where I’m having some problems. Of whatever I drop into the dropzone, instead of setting the hidden field’s value to a static string, I want to set it to the ID of whatever it was I dropped into the dropzone. This is what I changed:

 $('[id$="myHidden"]').val($(ui.draggable).attr("id"));
    __doPostBack('<%= HiddenButton.UniqueID  %>', '');
    alert($('[id$="myHidden"]').val());

Now all of a sudden, when I drop something it stays glued to the dropzone, and no drop event fires. Did I break something? Or am I trying to get the ID of the dropped element the wrong way?

In case it matters, here is the relevant aspx page stuff:

<asp:Button ID="HiddenButton" runat="server" Text="Button" />         

That button is typically hidden via css, I just left it unhidden for now for testing purposes.

EDIT!!!!:

I tried this as well, and it does not work (so I can rule out the ‘var’ thing?)

var foo = $(ui.draggable).attr("id")
    $('[id$="myHidden"]').val(foo);
    __doPostBack('<%= HiddenButton.UniqueID  %>', '');
    alert($('[id$="myHidden"]').val());
  • 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-11T18:32:45+00:00Added an answer on May 11, 2026 at 6:32 pm

    In your drop function, you are not providing any formal parameters:

    drop: function() { 
    

    should be

    drop: function(ev, ui) {
    

    I’m guessing this expression in your drop callback:

    $(ui.draggable).attr("id")
    

    is failing because the ui object cannot be referenced within the scope of the function.

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

Sidebar

Related Questions

With the help of this community, I was able to produce a query using
Please help this beginner here... I have a SQL Server 2008 R2 running on
With the help of this community, I just recently solved some issues with PHPExcel
I need the community's help on this. We have TFS 2010 and SharePoint services
I've been full of questions lately, but thanks to this awesome community, I'm learning
I would appreciate help with using decompose.graph , community detection functions from igraph and
I've been given a problem that I need some assistance from the SO community
Any one able to help me identify this cross browser CSS issue http://bit.ly/HC1c2u In
Please help this would be my last problem in dealing with access database with
Not sure if yall can help this time, as I'm just using this particular

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.