Problem in retrieving value

Hi, I need some help for this onclick function, my problem is that i could not get the exact value returned by the ajax.
for example the value should be like this

000005

when i tried to alert, it will only gives me 5 not 000005


$(function(){
   $.ajax({
       type: 'post',
       url: 'to_other_page.php',
       data: {id:id},
       success: function(data){
          some code here...

      }
   });

});


function LoadMyData(idx){
   alert(idx);
    $.ajax({
       type: 'post',
       url: 'Studentpage.php',
       data: {id:idx},
       success: function(data){
          some code here...

      }
   });


}



here is the separate file,
this is where i am going to use the onclick function

to_other_page.php

let’s just assumed that i have successfully queried the student table.



   $query = mysql_query('select * from student');
   while ($row = mysql_fetch_array( $query))  {
   <tr onclick="LoadMyData('.$row['std_id'].')">
                                <td >$row['std_id']</td>
                                 <td >$row['std_name']</td>

                       </tr>
 }


when i opened the console in firebug i can see that the inside of my function is 000005
but when it returned to other page it will only alert 5.

can you please help me what is wrong with this.

Thank you in advance.

At least someone didn’t think the number was octal.

Actually, with 5, it could have been… javascript does, anyway, but I dunno about browsers themselves.

Anyway, are you doing math with this number? If so, make sure nobody mistakes it for octal: do a parseInt(000005, 10) (this gives you 5 but it means when your next number is 000031 it won’t be interpreted as, say, 25).
Or, force it into a string. Wrap quotes around it or something. If you’re not mathing with it.

if the formatting is super-important for your users, you could use a little function that manually adds one or more zeros (as strings) to your number, before presenting to the user.