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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:54:57+00:00 2026-06-10T20:54:57+00:00

I have a simple form in a ASPX page that have a lot of

  • 0

I have a simple form in a ASPX page that have a lot of <label> and <asp:TextBox> pairing that construct the outlay of the form.

I have a requirement to add a string behind the textbox to indicate that the field is compulsory. I’d tried adding either a <span>, a <em> or a <div> after the field but it will still display the message at the bottom of the textbox.

Any way for me to achieve this?

EDIT:
I mean right hand side of the textbox, not behind as in watermark. My Bad.

EDIT for sample code:
I’d tried all the suggestion but it is still not working, thinking whether it’s my code issue or not. Below are my codes:

<label>Telephone No.</label>
<asp:TextBox ID="txtTelNo" runat="server"></asp:TextBox>
<span class="afterInput">test</span> 

any pointers? Thanks.

EDIT for Answer
As it turns out the problem lies in the css property. The template that i used has all the input assigned with the display: block property, which makes anything after the <input> element to be pushed down.

After creating a custom css class with display: inline-block and assign to them appropriately, i manage to get the result that i wanted.

Many thanks for the answer provided, especially the :after attributes and the watermark attributes.

  • 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-10T20:54:59+00:00Added an answer on June 10, 2026 at 8:54 pm

    See http://jsfiddle.net/ekWG9/

    .required:after{
        content: "*";
        color: red;   
    }​
    
    <label>A box</label><input type="text" value="Hello" /><span class="required"></span>​
    
    <!-- alternative HTML -->
    
    <span class="required"><label>A box</label><input type="text" value="Hello" /></span>​
    

    Using the :after pseudo element selector allows you to take the literal content out of the markup (e.g. you don’t have to repeat “*” over and over).

    You can also use relative or absolute positioning to tweak the location of the content of the :after pseudo element. Example: http://jsfiddle.net/ekWG9/1/

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

Sidebar

Related Questions

I have simple aspx page that has a form and a input field in
I have a simple form that passes to an ASPX page to watch a
I have a simple aspx page that streams Infopath form data to the client.
I have a simple ASP.NET form with a DropDownList and two RadioButtons (that both
So, I'm making an ASP.NET page in C#. I have a very simple form
I have a simple ASP.NET page that uses the VLC media player to play
I have a simple ASP.NET page that users can browse to, select a file
I have a simple form that looks like this: <%= simple_form_for @study,:url => studies_path,
I have a simple form for generating reports that I am adding a jqueryUI
I have a simple form that looks like so <% remote_form_for post, :url =>

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.