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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:04:01+00:00 2026-06-08T16:04:01+00:00

I am using the following function to change the padding in a column on

  • 0

I am using the following function to change the padding in a column on my forms:

function padTitles() {
    $('#option-grid #dataTable tr, #topic-grid #dataTable tr')
        .each(function () {
            var tds = $(this).find('input'),
        text = tds.filter('[id^="input_TempRowKey_"]').val(),
        tdToPad = tds.filter('[id^="input_Title_"]'),
        pad;
            if (/\.0$/.test(text)) {
                pad = 10;
                level = 1;
            } else {
                pad = 35;
                level = 2;
            }
            tdToPad.css('margin-left', pad);
            a = tdToPad.closest('tr');
            if (tdToPad.closest('tr').get().className) {
                tdToPad.closest('tr').get().className = tdToPad.closest('tr').get().className.replace(/\blevel\-.*?\b/g, 'level-' + level);
            } else {
                tdToPad.closest('tr').addClass('level-' + level)
            }
        });
}

It works well for this form HTML:

<td id="title_1" class=" ">
   <input type="text" value="Tests" name="item.Title" id="input_Title_1" >
</td>

Now I would also like it to work for the following HTML:

<td id="title_1" class=" ">    
  <textarea name="item.Title" id="input_Title_1">Tests</textarea>
</td>

Is there a way I can change this function so it works for either an input or textarea? I assume the way to do this is to change var tds = $(this).find('input'), however I am not sure how to change it or even if it’s possible to change to “find” either a textarea or an input.

  • 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-08T16:04:02+00:00Added an answer on June 8, 2026 at 4:04 pm

    Use a comma to union multiple queries:

    var tds = $(this).find('input, textarea');
    

    You can also use :input as a selector, but it’s not as efficient and may also include some things you’d rather not include.

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

Sidebar

Related Questions

I am currently using the following code to update form data before submission. $('.countyx').change(function(){
I'm using the following function call: var filesfound = filterSplit.SelectMany( filter => folder1.GetFiles( filter,
I'm using following jQuery function to change the opacity of text (it's color: #999999)
I am using following code to populate DropDown: $(document).ready(function(){ $('#inDistrict').sSelect(); $(#inDistrict).change(function(){ $.getJSON(filldistricts.php,{id: $(this).val(), ajax:
I have painted a checkbox against each row in my datatable using the following
I have the following function: $('#topic').change(function() It acts on an ID that's called #topic.
I'm using the following function to put each facility node of my XML in
I'm using jQuery to re-populate a DropDownListFor using the following code: $('#Teste).change(function () {
Using following code: db.changes({'include_docs':true}).on('response', function (res) { res.on('data', function (change) { console.log(change); }); });
I'm using the following function that changes a calendar selection at a set time

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.