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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:24:20+00:00 2026-06-13T19:24:20+00:00

I have this AngularJS code trying to show two stars next to label when

  • 0

I have this AngularJS code trying to show two stars next to label when there is no text in the textarea. Same code works for input tags, but not with textarea.

<div class="input-left">
    <label for="email">
        <span ng-show="contactform.email.$error.required" class="required">*</span>Email:
    </label>
    <input ng-model="email" type="text" name="email" id="email" required></br></br>
    <label for="budget">Budzet:</label>
    <input ng-model="budget" type="text" name="budget" id="budget">
</div>
<div class="clearboth">
    <label for="msg" class="left" >
        <span ng-show="contactform.msg.$error.required" class="required">**</span>Pitanja ili Komentari?
    </label>
    <textarea ng-model="msg" rows="8" cols="50" class="input-no-width rounded shaded left clearboth" id="msg" required></textarea>
</div>

According to AngularJS documentation – textarea should behave same as 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-13T19:24:21+00:00Added an answer on June 13, 2026 at 7:24 pm

    Your problem with the <textarea> tag is that it doesn’t define name attribute.

    AngularJS uses the name attribute to expose validation errors.

    You should define your textarea like so:

    <textarea ng-model="msg" name="msg" rows="8" cols="50"
              class="input-no-width rounded shaded left clearboth" id="msg" required>
    </textarea>
    

    Please note that having id and ng-model is not enough to properly handle validation messages. In AngularJS applications the id attribute often doesn’t serve much purpose and could be omitted.

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

Sidebar

Related Questions

I'm new to angularjs and python and I have this problem. I've been trying
Hi there I have this confirmable button directive which I am working on, The
I have this code http://plnkr.co/edit/kiH0Ge?p=preview <!doctype html> <html ng-app=plunker > <head> <meta charset=utf-8> <title>AngularJS
have this code import threading def Thread(f): def decorator(*args,**kargs): print(args) thread = threading.Thread(target=f, args=args)
have this html: <div id=editable contentEditable=true > <span contentEditable=false >Text to delete</span> </div> need
I have this code in jQuery, that I want to reimplement with the prototype
I'm trying to use a jQuery plugin ( Plupload ) with AngularJS. I have
I have this piece of html code in my application (the ng-app and ng-controller
Have this <a href=#>something</a> and then I handle it in Jquery code. This displays
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt

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.