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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:29:05+00:00 2026-06-13T13:29:05+00:00

I am loading varchar(10) values that may have leading zeroes, as key fields for

  • 0

I am loading varchar(10) values that may have leading zeroes, as key fields for lookup. In the grid the values display with the leading zeroes. When the key value is passed to the function, through the select, the zeroes are missing.

        gridComplete: function () {
        var ids = jQuery("#grdProductGrid").jqGrid('getDataIDs');
        for (var i = 0; i < ids.length; i++) {
            var cl = ids[i];
            var rowId = $("#grdProductGrid").getRowData(cl);
            be = "<a href='#'>Product</a >";
            be = "<a href='#' onclick='GetProduct(" + rowId['ID'] + ")'>Product</a >";

When I get to the GetProduct function the leading zeroes are missing.

Is there a string function I am missing when I load the selects? Or should I be doing something else here

  • 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-13T13:29:06+00:00Added an answer on June 13, 2026 at 1:29 pm

    You aren’t passing the ID as a string to GetProduct.

    be = "<a href='#' onclick='GetProduct(" + rowId['ID'] + ")'>Product</a >"; will generate a link that looks something like this:

    <a href='#' onclick='GetProduct(000123)'>Product<a/>

    000123 isn’t a string literal there, so javascript is thinking it’s a number. Try this when creating the links:

    be = "<a href='#' onclick='GetProduct(\"" + id + "\")'>Product</a >";

    I added the \" in side the parentheses of GetProduct. This will generate a link that looks like:

    <a href='#' onclick='GetProduct("000123")'>Product<a/>

    See this Fiddle: http://jsfiddle.net/gromer/deSGV/ (outputs into the console).

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

Sidebar

Related Questions

I have a situation where I have an incoming data value that may or
Assuming I have a table Entities with the columns Value and Type as varchar(strings)
Often I have stored credit card numbers in varchar(16) . That works, but it
On loading the page I want to pass a value to my javascript function
i have a table [Company] with a column [Address3] defined as varchar(50) i can
I have a database of zipcodes in this format: zip varchar(11) state char(2) latitude
[Note : I've simplified my example for clarity] Let's say that I have a
I have a tool that generates a DDL script create table ATTRIBUTE_VALUE ( id
I have a field number of type varchar . Even though it is of
I have the following data: stockcode (CHAR) | description (VARCHAR) ---------------------------------------------- 1234 | some

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.