Second-level linkage js script

Source: Internet
Author: User

 

// Second-level interaction Description: the value of the select statement must match the value of allinfo. The array format of all values of the second-level interaction is value | text

 

// Jia Shiyi

 

Www.2cto.com

Function selectChange (obj, changeId, allinfo ){

Var selValue = obj. options [obj. selectedIndex]. value; // obtain the selected value in the select object.

Var objChange = document. getElementById (changeId );

If (objChange ){

ObjChange. options. length = 0;

For (I = 0; I <allinfo. length; I ++ ){

If (allinfo [I]. substring (0, selValue. length) = selValue ){

ObjChange. options. length ++;

Var p = allinfo [I]. indexOf ("| ");

Var text = allinfo [I]. substr (p + 1 );

Var value = allinfo [I]. substr (0, p );

ObjChange. options [objChange. options. length-1] = new Option (text, value );

}

}

}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.