This is a migrated thread and some comments may be shown as answers.

take variables with asp

2 Answers 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 14 May 2012, 03:14 PM

hello please excuse my English :)

I have a grid in which I want to send a value to another asp page and take the data from that page.

I have a button of the grid in a form from which I make a redirect to the asp page and from there take the value creating html objects in a container I put the value which has a field that I have next to the grid in asp page tome that data and do the update of the value in a table.

My problem is that when I make shipments only works if I make the example with the first field and makes the update in the table but if I do the same with the second field of the grid no longer works.
the same goes for the second forward.
      <script src="datoss.asp"></script>
<
div id="domSelection" style="width:620px; height:300px"></div>
 
                       <script>
                  $(document).ready(function() {
                    $("#domSelection").kendoGrid({
                        dataSource: {
                            data: FuncionDellenado3()
                            
                        },
                        selectable: "multiple",
                        pageable: true,
                        scrollable: true,
                        navigatable: true,
                       columns: [
                           { field: "FirstName", title: "productos", format: "{0:c}", type:"String",editable: false, width: "150px" },
                            { field: "City", title: "cantidad", editable:true, type:"Number", validation: { min: 1, required: true },width: "150px" },
                            {field: "BirthDate", title: "fecha de Entrega",type:"String",editable:true,width:"150px"},
                            { field: "favoritos", title: "favoritos", editable:true, type:"String",width: "150px" },
                            {field: "boton", template: "#=  '<form id=\"form3\" method=\"post\" action=\"activauno.asp\"><input type=\"submit\"id=\"boton3\" class=\"boton3\" value=\"3\"/></form>' #", title: "favorito", width: "100px",type:"String", editable:false },                         
                            { field: "añadir", template: "#= '<input type=IMAGE SRC=\"add.gif\"\id=\"añadir\" value=\"CODE\" />' #", title: "añadir", width: "210px",type:"String", editable:false }],
                            editable: true
                    });
                        });
            </script>
 <script>
     
             $(document).ready(function(){ 
$('.boton3').click(function() {
             var x=document.getElementById("boton3").value;
              
             var sourcegrid = $('#domSelection').data('kendoGrid');      
             
            sourcegrid.select().each(function () {
             
               var dataItem = sourcegrid.dataItem($(this));
                var column = dataItem.favoritos;
                    var nomb = dataItem.FirstName;
                fi = document.getElementById('form3');
  
            contenedor = document.createElement('div');
            contenedor.id = 'div1';
            fi.appendChild(contenedor);
   
            ele = document.createElement('input');
            ele.type = 'text';
            ele.value = column;
            ele.name = 'favo';
            ele.id = 'campo';
            contenedor.appendChild(ele);
                 
                ele = document.createElement('input');
            ele.type = 'text';
            ele.value = nomb;
            ele.name = 'nomb';
            ele.id = 'campo2';
            contenedor.appendChild(ele);
                 
                     });
                     
            });
                     
    });
    </script>

and my code asp
<%
 
  Dim clientes, nombre2, nombre, material
  
     
nombre2 = Request("nomb")
response.write(nombre2)
nombre = Request("favo")
response.write(nombre)
nombre2=Replace(nombre2,"Ñ","?")
%>
please help!


regards.

2 Answers, 1 is accepted

Sort by
0
Ricardo
Top achievements
Rank 1
answered on 14 May 2012, 04:36 PM
hello
I think I found the solution to my problem what happens is that when I submit it sends only the first form on the grid since all have the same name and that makes only send the form data that is occurring here in but the submit form elements created in the first pass only to the asp page when you click the button to submit the first form.

¬¬
0
Ricardo
Top achievements
Rank 1
answered on 14 May 2012, 04:59 PM
now my question changes
you can add a variable which is the form id?

{field: "boton", template: "#=  '<form id=\"form #count#\" method=\"post\" action=\"prueba9.asp\"><input type=\"submit\"id=\"boton3\" class=\"boton3\" value=\"3\"/></form>' #", title: "favorito", width: "100px",type:"String", editable:false },

regards!!
Tags
Grid
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Ricardo
Top achievements
Rank 1
Share this question
or