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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:19:13+00:00 2026-06-07T06:19:13+00:00

I have to use dynamic ids in my form, based on jsp variables in

  • 0

I have to use dynamic ids in my form, based on jsp variables in a scriptlet. How can I select the correct element using jQuery’s id selector without getting errors?

Here’s my code:

<form name="intakeOnly" id="intakeOnly_<%=complaint%>" method="post" action="../Intake.do">
<table class="normal">
  <tr>
    <td><b>Clinician Signature: </b> <span id="cSigI_<%=complaint%>"><%=clinicianSig%>,<%=signedDate%></span></td>
  </tr>
  <tr>
    <td><input type="button" id="submitSig_<%=complaint%>" name="submitSig" value="Sign and Save" onClick="intakeSubmit();"></td>
  </tr>
</table>
</form>

Javascript:

function intakeSubmit() {
   var complaint = <%=complaint%>;
   var fname = new String("<%=userFirstName%>");
   var lname = new String("<%=userLastName%>");
   var date = new String("<%=DateUtils.getDate()%>");
   jQuery("#cSigI_"+complaint).append("<br>"+fname+" "+lname + ","+ date); 
}
  • 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-07T06:19:15+00:00Added an answer on June 7, 2026 at 6:19 am

    This line:

    var complaint = <%=complaint%>;
    

    should be

    var complaint = "<%=complaint%>";
    

    The lines following that should be changed to match that syntax, new String(str) isn’t needed.

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

Sidebar

Related Questions

If you use dynamic pages like JSP or asp.net, you can have your page
I have a stylesheet that makes use of exslt:dynamic module and more precisely, it
Hi I have a really complicated dynamic query that i want to use to
I have a telerik grid with a dynamic data source (the grid may use
I have been trying to use dynamic LINQ to Entity in my application for
I have, essentially, an unlimited number of containers with dynamic ids and a dynamic
So I have a script that makes dynamic form content and each input has
So I have a script that makes dynamic form content and each input has
In a webproject i have a complex form to build a dynamic query. When
I have a page which has a series of dynamic jquery ui dialogs which

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.