dynamic drop down list in wordpress

  • Author
  • #1100413

    pls help me out,
    im trying add dynamic drop down list in wordpress, but failed
    its works fine when executed on browser normally.. but fails when i add it on wordpress pages
    thank you…..

    here is the code

    <script language=”javascript”>
    var arr = new Array();
    arr[0] = new Array(“-select-“);
    arr[1] = new Array(“Maharashtra”,”Karnataka”,”Andhra Pradesh”,”Tamil Nadu”);
    arr[2] = new Array(“Carinthia”,” Styria”);
    arr[3] = new Array(“Florida”,”New York”,”Maryland”);
    arr[4] = new Array(“Queensland”,”Victoria”,”Tasmania”,”New South Wales”);

    function change(combo1){
    var comboValue = combo1.value;
    for (var i=0;i<arr[comboValue].length;i++){
    var option = document.createElement(“option”);
    option.innerHTML = arr[comboValue][i];
    <form name=”form” method=”post”><select name=”combo1″ onchange=”change(this);”>
    <option value=”0″>-Select-</option>
    <option value=”1″>India</option>
    <option value=”2″>Austria</option>
    <option value=”3″>USA</option>
    <option value=”4″>Australia</option>
    <select name=”combo2″>

    The blog I need help with is anilkumarmudiraj.wordpress.com.



    Users are not allowed to post JavaScript on WordPress.com blogs. The software strips it out for security reasons. http://en.support.wordpress.com/code/#javascript

The topic ‘dynamic drop down list in wordpress’ is closed to new replies.