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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:06:24+00:00 2026-05-24T07:06:24+00:00

I have a jquery function and a javascript validation script running on the forms

  • 0

I have a jquery function and a javascript validation script running on the forms of my page.

On one form, the input IDs are generated dynamically with “.” – this seems to be causing an issue and breaking the function.

Any obvious work around?

function:

function customAlert(){
    var args = arguments;
    if(args.length > 1) {
        // check that custom alert was called with at least two arguments
        var msg = args[0];
    $(".giftmessaging").removeClass("alertRed");
        $("li").removeClass("alertRed");
        $("input").removeClass("CO_form_alert");
        $("select").removeClass("CO_form_alert");
        var div = $(".errorPopup");
        div.css({"display":"block"});

        div.html(msg);
        for(var i = 1; i < args.length; i++) {
            var inputID = args[i];
           $("#"+inputID).addClass("CO_form_alert");
       $(".giftmessaging").addClass("alertRed");
       $('#' + inputID).focus();
       $('#' + inputID).keydown(function() { $('.errorPopup').hide(); }).change(function() { $('.errorPopup').hide(); });

        }
     }

}

Example validation section:

couponAlert(msg_601,"frmCPN.Number_1")

and an example of the generated ids:

input title="Coupon <%=i%> Coupon Number" type="text" class="CO_PM_VisaCouponsNumberInput<%=redText%>" id ="<%=LLBECOrderConstants.LLB_PAYDEVICE_COUPONFORM%>.<%=LLBECOrderConstants.LLB_PAYDEVICE_NUMBER%>_<%=i%>" name="<%=LLBECOrderConstants.LLB_PAYDEVICE_NUMBER%>_<%=i%>" size="15" maxlength="15" value="<%=txtbxCPID%>" class="redeemNum" onKeyPress="return checkEnter(event,'<%=LLBECOrderConstants.LLB_PAYDEVICE_COUPONFORM%>')"/> 
</div>
  • 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-24T07:06:24+00:00Added an answer on May 24, 2026 at 7:06 am

    If you need to get an element by ID, and the ID has chars which jQuery could confuse for selector syntax ( ., :, etc), use the attr selector for ID instead:

    $( '[id="' + inputID '"]' )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jquery function > <script type=text/javascript> > > $(document).ready(function() { >
I have this simple function: <script type=text/javascript> //<![CDATA[ jQuery(function($){ function here(b){alert(b);} ; here(6); });
i have a jquery form validation in the master page and it works fine
I have a form with two input textboxes, and I have included jQuery validation
I have jquery function as validationtype its working fine <script type=text/javascript> jQuery.validator.addMethod(mytest, function (value,
I am using jquery validation plugin for validation. I am using one javascript function
I have a javascript function generateGraph() { ... jQuery.get('chart.php?month='+month+'&year='+year); document.getElementById('graph').src = 'charts/'+month+'_'+year+'.png'; ... }
I have a javascript/jQuery block as a callback after $.get function: function myCallBack(data, textStatus)
I have problems with the following bit of javascript/jquery code: this.droppable = function(){ $('.imageWindow
I have a jQuery UI Dialog working great on my ASP.NET page: jQuery(function() {

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.