Increasing the length of a var in a javascript function

I need the length of the variable 'abbr' increased to 45 because it is being truncated when being display on the website textbox control.

<script language="javascript" type="text/javascript">

function doSubmit()
{
      cidabbr = document.frmAddCertification.CertificationId.options(frmAddCertification.CertificationId.selectedIndex).value;
      
      if (cidabbr.length > 0)
      {
          cidabbr = cidabbr.split('||')
          cId=cidabbr[0];
           abbr=cidabbr[1];
          //alert(cId);
          //alert(abbr);
          initVal = window.opener.frmTransferRequest.RequestCertifications.value;
          //alert(initVal);
          window.opener.frmTransferRequest.RequestCertifications.value = initVal + ' ' + abbr + ',';
          //alert(window.opener.frmTransferRequest.RequestCertifications.value);
          self.close();
      }
}
                              
</script>
keithwilson1developerAsked:
Who is Participating?
 
nap0leonCommented:
The value for "abbr" is whatever you want it to be.  It's length is determined by the value.

e.g.,
if abbr="1234567890", its length is 10.
if abbr="12345678901234567890", its length is 20.
if abbr="123456789012345678901234567890", its length is 30.
etc.

When you say the value is truncated, do you mean it is literally truncated,
e.g., abbr="12345678901234567890" but on your opener form only "123456789012345" makes it into the form?

or is it a display issue, where the form field is not wide enough for the user to see all of it?

In either case, what are the attributes of the RequestCertifications field?
It sounds like either "size" or "max-length" might be to blame.
http://www.tizag.com/htmlT/htmltextfields.php
0
 
nap0leonCommented:
Do you want to just change this line:
abbr=cidabbr[1];

Open in new window


to this?
abbr=45;

Open in new window

0
 
keithwilson1developerAuthor Commented:
I want 'abbr' to receive the value of 'cidabbr[1] but increase the size of 'abbr' from 30 to 45 to be able to display the full description that is being passed to it.
0
 
keithwilson1developerAuthor Commented:
the value passed to abbr is 'English Technology and Science' but when the value is moved to my display field it is 'english Technology and Scien'.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.