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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:26:08+00:00 2026-05-14T18:26:08+00:00

Trying to debug something that basically .trim()’s, .val()’s and .length’s a textarea input as

  • 0

Trying to debug something that basically .trim()’s, .val()’s and .length’s a textarea input as HTML below (truncated):

<form id="Kontaktanfrage" method="post" action="tests/testform/">
...
<textarea cols="50" rows="8" id="el_12" name="FORM[Kontaktanfrage][el_12]" title="Ihre Nachricht: *" class="textarea required"></textarea>
...
</form>

JavaScript:

function validateField(formId, fieldId) {
if (fieldId) {
    var element = "form#"+formId+" input#"+fieldId;
    var fieldValue = jQuery.trim(jQuery(element).val());
    var fieldLength = fieldValue.length;
    var fieldError = "";
    if ($(element).is('.textarea.required') && fieldLength == 0) {
        fieldError = "error message";
    }
}

}

The above if check is never true.

Using JQuery: 1.4.1.

Having seen other examples online, I can’t see what the difference should be. Feel free to test it in FireBug at (http://www.initiat.de/tests/testform/). Any help appreciated, can’t see what I’m doing wrong.

  • 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-14T18:26:09+00:00Added an answer on May 14, 2026 at 6:26 pm

    You’re creating your selector assuming that all of your fields are Input elements. TextArea is a different element and your selector should reflect that. I don’t think that performance will take a big hit if you change this line

    var element = "form#"+formId+" input#"+fieldId;

    to this

    var element = "form#"+formId+" #"+fieldId;

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

Sidebar

Ask A Question

Stats

  • Questions 542k
  • Answers 542k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Well, it stucks up if you don't have a list… May 17, 2026 at 6:11 am
  • Editorial Team
    Editorial Team added an answer Wait - Windows Forms is a .NET technology. Do you… May 17, 2026 at 6:11 am
  • Editorial Team
    Editorial Team added an answer This encoding is called Quoted-printable. In your example, you have… May 17, 2026 at 6:11 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am trying to debug a strange issue with users that have LogMeIn installed.
I am trying to debug an ActiveResource call that is not working. What's the
I'm trying to debug into a C dll that is invoked on a Windows
I'm trying to debug something and I'm wondering if the following code could ever
Basically I was trying to replicate one of the things that xajax gave me
I'm trying to debug a Chromium extension with console.log() , but I noticed that
Trying to debug an issue with a server and my only log file is
I'm currently trying to debug a customer's issue with an FTP upload feature in
I'm trying to debug a deadlock in a multi-threaded Python application after it has
I'm trying to debug an application (under PostgreSQL) and came across the following error:

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.