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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:32:22+00:00 2026-06-13T08:32:22+00:00

I am unable to validate the textarea below, don’t know what’s wrong with my

  • 0

I am unable to validate the textarea below, don’t know what’s wrong with my code.

<div id="chooseForm">
    <input type="checkbox" name="ArticlesOrderForm" value="ArticlesOrderForm">
    <b>Articles Order Form </b>
</div>';

$echo .= '  <script>
        jQuery(function($) {
            $(".formGroup").hide();
            $("#chooseForm input:checkbox").on("change", function() {
                if($(this).is(":checked")) {
                    $("#" + $(this).val()).show();
                }
                else {
                    $("#" + $(this).val()).hide();
                }
            });
        });

    </script>';

     $echo .=  '<div id="ArticlesOrderForm" class="formGroup">
                <legend>Articles Order Form</legend>
                <b><label for="article_keywords">Keywords/Titles<span class="reqd">*</span> : </label></b> <textarea rows="6" cols="50" id="article_keywords" name="article_keywords" > </textarea>
            </div>';
<br/><br/>

if($_POST['ArticlesOrderForm'] == 'checked') {  

  if(!isset($_POST['article_keywords']) || empty($_POST['article_keywords'])) {
    $myerror= '<li>'.__('<strong>Keywords/Titles</strong> - missing.','article_keywords').'</li>';
    }   
}

I should get a message ‘keywords/titles – missing’ if someone does not enter into that text area..
Could anyone please tell me whats wrong in my logic?

Please find the full codes here : http://jsfiddle.net/DTcqk/3/
and here: http://jsfiddle.net/YYAbm/

  • 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-13T08:32:23+00:00Added an answer on June 13, 2026 at 8:32 am

    Your textarea is not empty by default:

    <textarea rows="6" cols="50" id="article_keywords" name="article_keywords" > </textarea>
                                                        you have space here ----^
    

    So it won’t enter your following if :

    if(!isset($_POST['article_keywords']) || empty($_POST['article_keywords'])) {
    

    You should use trim() if you want to catch variables with only spaces in your validation if, like so:

    $_POST['article_keywords'] = trim($_POST['article_keywords']);
    if(!isset($_POST['article_keywords']) || empty($_POST['article_keywords'])) {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The below code to validate TextBox is working fine onkeypress but when I use
I'm trying to validate the following XML but I'm unable to, can you please
Unable to cast object type System.Collections.Generic.List 1[NorthwindMVC3.Models.Product] to the type ofSystem.Collections.Generic.IEnumerator 1[NorthwindMVC3.Models.Product].\ public IEnumerator<Product>
I'm unable to execute the following prepared statement , PREPARE stmt FROM 'SELECT sb.id,sb.category,sb.make,sb.name,sb.pic,rs.slot
I'd like to validate a form using the jquery validate plugin, but I'm unable
Below is the link to the code that has the two RAdEditors I am
Unable to figure this one out... In the below form, all of the inputs
I'm unable to get my form validation below to respond unless I enter text
I have a BPEL application in 11g with the schema-validate-input property of the binding
Currently unable to get my rss feed to validate through W3C RSS Validator .

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.