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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:03:48+00:00 2026-06-06T00:03:48+00:00

function getDbValue() { alert($(‘[data-bind]’).length); alert($(‘[data-bind][0].data-bind’)); alert($(‘[data-bind][0].value’)); jQuery.each($(‘[data-bind]’), function(databind,key) { alert(key); alert(databind); alert(databind[key].data-bind); }) }

  • 0
    function getDbValue()
{
    alert($('[data-bind]').length);
    alert($('[data-bind][0].data-bind'));
    alert($('[data-bind][0].value'));
    jQuery.each($('[data-bind]'), function(databind,key)
    {
        alert(key);
        alert(databind);
        alert(databind[key].data-bind);
    })

}

The above is my function and i want to read all inputs that have the properties data-bind within them for example

<input type="text" id="frmIn1-Officer" data-bind="value: AOfficer" class="InputText"/>

^ When running my function i would want it to return ‘AOfficer’ as that is the data-bind value.

So an example is

<input type="text" id="frmIn1-Officer" data-bind="value: AOfficer1" class="InputText"/>
<input type="text" id="frmIn1-Officer" data-bind="value: AOfficer2" class="InputText"/>
<input type="text" id="frmIn1-Officer" data-bind="value: AOfficer3" class="InputText"/>
<input type="text" id="frmIn1-Officer" data-bind="value: AOfficer4" class="InputText"/>
<input type="text" id="frmIn1-Officer" data-bind="value: AOfficer5" class="InputText"/>
<input type="text" id="frmIn1-Officer" data-bind="value: AOfficer6" class="InputText"/>

And in the for each loop i would like to be able to use the value of data bind..
e.g values[0] = ‘AOfficer1’

Sorry if my explanation is slightly confusing, i have the idea in my head perfect but trying to put it in writing is alot harder.

  • 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-06T00:03:50+00:00Added an answer on June 6, 2026 at 12:03 am

    jQuery interprets the “data-something” attributes differently than other attributes. So you should select all your elements and look for their data bindings like this:

    $(document).ready(function(){
        $('input.InputText').each(function(){
            var input = $(this);
            if ($(input).data().bind) {
                alert($(input).data().bind);
            }
        });
    });​
    

    Then you can do string manipulation to parse out your values, I’d suggest using JSON and just loading it in like an object. Here’s a working fiddle: http://jsfiddle.net/3NERK/6/

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

Sidebar

Related Questions

function randomString( len ) { // A random string of length 'len' made up
I am doing this : function GETVALUE() { if(document.getElementById(requirenewpage).checked == true) { document.getElementById(requirenewpage).value; var
The code for the second alert command works as intended (displaying the value of
here is my code for a custom jquery plugin : (function($){ $.fn.extend({ getmyValue :
function t1() { echo 1; } function t2() { echo 2; } $funcs =
function now(){ return +new Date; } questions : what does the plus sign mean?
/************************************************************************** * * Function: toggleVis * * Description: Following Function hides and expands the
function icPageInit() { $(icImgDiv + icAlternate()).setOpacity(0); return true; } window.onload = icPageInit; This piece
function escCtrlChars(str) { return str.replace(/[\0\t\n\v\f\r\xa0'!-]/g, function(c) { return '!' + c.charCodeAt(0) + '!'; });
function showFields($selClient) { $result = mysql_query(SELECT * FROM project WHERE projectid = $selClient); $values

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.