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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:35:19+00:00 2026-05-22T12:35:19+00:00

I have a form with the following dynamically added row: <input type=text name=statuseffective id=statuseffective_0

  • 0

I have a form with the following dynamically added row:

<input type="text" name="statuseffective" id="statuseffective_0" class="datepicker" size="15" sid="0" ordr="0">  
<span style="cursor:pointer; text-decoration:underline; margin-bottom:-14px;" onclick="clearDate();">Clear</span> 

the name statuseffective with id of statuseffective_0 is a dynamically added row. To keep cracker jacks from entering dates such as 01/01/1752 into my text box, I’m having to make the field readonly using $('.datepicker').datepicker().attr("readOnly", true) since they were ignoring the jquery popup calendar. The default behaviour of datepicker still allows the user to key in dates using the keys – I need to prevent that. since the keys are now disabled, I need a way to allow the user to clear out the dates so I’m adding a “clear” option after the text input field. Since the rows can be dynamically added, how can I obtain the value of the input field just before the clear text? The code shown in the beginning of this post is what I’m working with.

  • 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-22T12:35:19+00:00Added an answer on May 22, 2026 at 12:35 pm

    I would take out the inline js and use .live()

    for the html

    <input type="text" name="statuseffective" id="statuseffective_0" class="datepicker" size="15" sid="0" ordr="0">  
    <span style="cursor:pointer; text-decoration:underline; margin-bottom:-14px;" class="clear">Clear</span>
    

    then in your doc ready

    $('.clear').live('click',function(){
            var before_val = $(this).prev().val();
            $(this).prev().val("")
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dynamic form with the following fields <tr> <td><input name = qty[]
I have a page with 80+ dynamically generated input boxes, when the user submits
I have the following problem. I’ve made a form which change the form elements
I have the following code, with which i try to dynamically pass my arguments
I have an requirement where i have to display some content on iframe dynamically.
I have a grid whose rows need to be resized dynamically based on the
I have a C# Winform application. In my form, I have a panel and
I am developing a windows form application in C#. I have a datagridview on
I have created a function (see below) that calculates a 7.5% sales tax. Now
Apologies if this is somewhat of a duplicate question, I did see others but

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.