SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2008
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sending dynamic created variable in ext js

    hi to all

    I am using ext js library to built ajax base site.I need to build dynamci variable and then send that variable with same name in paramter to php

    i have following function where first i check the array length and then loop untill the array lenght come to end and within that i get the value from html.now i want to send dynamic variables as parameter but i can do this

    Code:
    addvalue = function(){
    
    	var id_str=document.getElementById('array_chk').value;
    
    	var id_arr=id_str.split(",");
    
    	var arr_len=id_arr.length;
    
    	var wins = new Array();
    
    
    	for(i=0;i<1;i++)
    	{
    		
    
    		window['CB' + id_arr[i]]:document.getElementById('CB'+id_arr[i]).value,
    		window['CBD' + id_arr[i]]:document.getElementById('CBD'+id_arr[i]).value,
    		window['HT' + id_arr[i]]:document.getElementById('HT'+id_arr[i]).value,
    		window['ZT' + id_arr[i]]:document.getElementById('ZT'+id_arr[i]).value,
    		
    	}
    
    
    ocorporateActionAdministrationConnectionConfig.params = {
    
    				action_array:id_str,
    		}
    
    
    	ocorporateActionAdministrationConnection.request(ocorporateActionAdministrationConnectionConfig);
    }
    any help.

    thanks in advance.

  2. #2
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change this:

    Code JavaScript":
    ocorporateActionAdministrationConnectionConfig.params = {
     action_array:id_str,
    }

    to this:


    Code JavaScript":
    ocorporateActionAdministrationConnectionConfig.params = {
     action_array:id_str
    };

    There should be no trailing comma in an object's property list. It's also good practice, although not always strictly necessary, to end every statement with a semicolon.

    And, in the name of all that is holy, why do you use such looooooooong variable names? That's way too much scrolling, son!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •