Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6962275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:38:22+00:00 2026-05-27T15:38:22+00:00

I’m having a form that is created dynamically depending on the value selected, it

  • 0

I’m having a form that is created dynamically depending on the value selected, it makes various text inputs and depending if its a new reg the values are empty if not the values are populated with data from a mysql database, when i want to submit the form and make a new insert i try to get all the values from the inputs but no values are returned

$('input#send.clientenom').live('click', function (){
    var id_cliente = $('select#clienteslist.list').val();
    var contacto = $('.clientenom input[name="contacto"]').val();
    var cliente = $('.clientenom input[name="cliente"]').val();
    var direccion = $('.clientenom input[name="direccion"]').val();
    var colonia = $('.clientenom input[name="colonia"]').val();
    var estado = $('.clientenom input[name="estado"]').val();
    var cp = $('.clientenom input[name="cp"]').val();
    var telefono = $('.clientenom input[name="telefono"]').val();
    var email = $('.clientenom input[name="email"]').val();
    var acumulado = $('.clientenom input[name="acumulado"]').val();
    var tipocliente = $('.clientenom input[name="tipocliente"]').val();
    var prospecto = $('.clientenom input[name="prospecto"]').val();
    var nivel = $('.clientenom input[name="nivel"]').val();
    var proynom = $('.regname input[name="regproyname"]').val();
    alert(id_cliente, contacto, cliente, direccion, colonia, estado, cp, telefono, email, acumulado, tipocliente, prospecto, nivel, proynom);
            data = JSON.parse(data);     

    if(id_cliente == 0){

    var jqxhr = $.post("php/registrop.php",{"id_tipo":tipocliente, "id_prospecto":prospecto, "id_nivel":nivel, "contacto":contacto,"cliente":cliente, "direccion":direccion, "colonia":colonia, "estado":estado, "cp":cp, "telefono":telefono, "email":email, "acumulado":acumulado, "proyecto":proynom},function(data){
    if (typeof (data) == 'object' && JSON.parse ){

var html = '';
var len = data.length;
for (var i = 0; i< len; i++) {      
    var d = data[i];
    if(!d.error){
    if(d.Success == true){
html += d.Message;}
}else{
            alert(d.error);
    }}
    alert(d.Message);
    }else{

    alert("error no se puede parsear");
    }




        } )}else{
            var jqxhr = $.post("php/registrop.php",{"id_cliente":id_cliente, "proyecto":proynom},function(data){
                        data = JSON.parse(data);     
    if (typeof (data) == 'object' && JSON.parse ){

var html = '';
var len = data.length;
for (var i = 0; i< len; i++) {      
    var d = data[i];
    if(!d.error){
if(d.Success == true){
html += d.Message;
}

}else{
    alert(html);
    }}
            alert(d.error);
    alert("error no se puede parsear");
    }


        } )
            }
    });

the alert is just to debug to see the values but the only value i get is id_cliente val no other value is added do i need to bind o delegate the inputs? also my submit button is type button not submit so it wont reload the page thanks in advance!

the form is created this way:

  function selectedcliente(){
var id_clientea = $('select#clienteslist.list').val();
if($('form#info.customForm').length > 0 || id_clientea == ""){

    $('.clienteinfo').empty();
            }
if(id_clientea == 0){
var html = '';
html += '<form class="customForm" id="info">' +
'<div>' +
'<label for="contacto">Contacto</label>' +
'<input type="text" name="contacto" class="clientenom" value=""/><span id="contactoinfo">Nombre del contacto del cliente</span>' +
'</div>' +
'<div>' +
'<label for="cliente">Cliente</label>' +
'<input type="text" name="cliente" class="clientenom" value=""/><span id="clienteinfo">Nombre de la empresa/cliente</span>' +
'</div>' +
'<div>' +
'<label for="direccion">Direccion</label>' + 
'<input type="text" name="direccion" class="clientenom" value=""/><span id="direccioninfo">Direccion de la empresa</span>' +
'</div>' +
'<div>' +
'<label for="colonia">Colonia</label>' +
'<input type="text" name="colonia" class="clientenom" value=""/><span id="coloniainfo">Colonia de la empresa</span>' +
'</div>' +
'<div>' +
'<label for="estado">Estado</label>' +
'<input type="text" name="estado" class="estado" value=""/><span id="estadoinfo">Estado donde se encuentra la empresa</span>' +
'</div>' +
'<div>' +
'<label for="cp">Codigo Postal</label>' +
'<input type="text" name="cp" class="clientenom" value=""/><span id="cp">Codigo Postal del lugar de la empresa</span>' +
'</div>' +
'<div>' +
'<label for="telefono">Telefono</label>' +
'<input type="text" name="telefono" class="clientenom" value=""/><span id="telefonoinfo">Telefono de la empresa</span>' +
'</div>' +
'<div>' +
'<label for="email">E&ndash;mail</label>' +
'<input type="text" name="email" class="clientenom" value=""/><span id="emailinfo">E&ndash;mail de la empresa</span>' +
'</div>' +
'<div>' +
'<label for="acumulado">Acumulado</label>' +
'<input type="text" name="acumulado" class="clientenom" value=""/><span id="acumuladoinfo">Total de todas las compras que se han hecho</span>' +
'</div>' +
'<div>' +
'<label for="tipocliente">Tipo del Cliente</label>' +
'<input type="text" name="tipocliente" class="clientenom" value=""/><span id="tipoclienteinfo">Que tipo de cliente es (Gobierno, Particular, Industrial, Distribuidor, Particular GR)</span>' +
'</div>' +
'<div>' +
'<label for="prospecto">Prospecto o Cliente</label>' +
'<input type="text" name="prospecto" class="clientenom" value=""/><span id="prospectoinfo">Prospecto o Cliente?</span>' +
'</div>' +
'<div>' +
'<label for="nivel">Nivel del Cliente</label>' +
'<input type="text" name="nivel" class="clientenom" value=""/><span id="nivelinfo">Nivel del cliente (depende del total acumulado)</span>' +
'</div>' +
'<div>' +
'<input type="button" class="clientenom" id="send" value="Registrar Proyecto" />' +
'</div>' +
'</form>'
;
        $('.clienteinfo').append(html);
}
else
{
var jqxhr = $.post('php/selectcliente.php',{"id_cliente":id_clientea}, function(data){
 data = JSON.parse(data);

 if(typeof(data) == 'object' && JSON.parse){
var html = '';
var len = data.length;
//alert(len);
for(var i = 0; i<len; i++){
var d = data[i];
    if(!d.error){

html += '<form class="customForm" id="info">' +
'<div>' +
'<label for="contacto">Contacto</label>' +
'<input type="text" name="contacto" class="clientenom" value="' + d.contacto + '"/><span id="contactoinfo">Nombre del contacto del cliente</span>' +
'</div>' +
'<div>' +
'<label for="cliente">Cliente</label>' +
'<input type="text" name="cliente" class="clientenom" value="' + d.cliente + '"/><span id="clienteinfo">Nombre de la empresa/cliente</span>' +
'</div>' +
'<div>' +
'<label for="direccion">Direccion</label>' + 
'<input type="text" name="direccion" class="clientenom" value="' + d.direccion + '"/><span id="direccioninfo">Direccion de la empresa</span>' +
'</div>' +
'<div>' +
'<label for="colonia">Colonia</label>' +
'<input type="text" name="colonia" class="clientenom" value="' + d.colonia + '"/><span id="coloniainfo">Colonia de la empresa</span>' +
'</div>' +
'<div>' +
'<label for="estado">Estado</label>' +
'<input type="text" name="estado" class="estado" value="' + d.estado + '"/><span id="estadoinfo">Estado donde se encuentra la empresa</span>' +
'</div>' +
'<div>' +
'<label for="cp">Codigo Postal</label>' +
'<input type="text" name="cp" class="clientenom" value="' + d.cp + '"/><span id="cp">Codigo Postal del lugar de la empresa</span>' +
'</div>' +
'<div>' +
'<label for="telefono">Telefono</label>' +
'<input type="text" name="telefono" class="clientenom" value="' + d.telefono + '"/><span id="telefonoinfo">Telefono de la empresa</span>' +
'</div>' +
'<div>' +
'<label for="email">E&ndash;mail</label>' +
'<input type="text" name="email" class="clientenom" value="' + d.correo + '"/><span id="emailinfo">E&ndash;mail de la empresa</span>' +
'</div>' +
'<div>' +
'<label for="acumulado">Acumulado</label>' +
'<input type="text" name="acumulado" class="clientenom" value="' + d.acumulado + '"/><span id="acumuladoinfo">Total de todas las compras que se han hecho</span>' +
'</div>' +
'<div>' +
'<label for="tipocliente">Tipo del Cliente</label>' +
'<input type="text" name="tipocliente" class="clientenom" value="' + d.tipo_cliente + '"/><span id="tipoclienteinfo">Que tipo de cliente es (Gobierno, Particular, Industrial, Distribuidor, Particular GR)</span>' +
'</div>' +
'<div>' +
'<label for="prospecto">Prospecto o Cliente</label>' +
'<input type="text" name="prospecto" clss="clientenom" value="' + d.prospecto + '"/><span id="prospectoinfo">Prospecto o Cliente?</span>' +
'</div>' +
'<div>' +
'<label for="nivel">Nivel del Cliente</label>' +
'<input type="text" name="nivel" class="clientenom" value="' + d.nivel + '"/><span id="nivelinfo">Nivel del cliente (depende del total acumulado)</span>' +
'</div>' +
'<div>' +
'<input type="button" class="clientenom" id="send" value="Registrar Proyecto" />' +
'</div>' +
'</form>'
;
    }else{
        alert(d.error); 
        }

    }
    $('.clienteinfo').append(html);
}else{
    alert("Is not object");

    }
    });
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:38:23+00:00Added an answer on May 27, 2026 at 3:38 pm

    .clientenom input[name="nivel"] is trying to find an input with a name of nivel that is within an element with the class of clientenom.

    This is not the case in your html. The input is not within .clientenom it has that class itself.

    Unless you have multiple inputs with the same name, just drop the class all together:

    var contacto = $('input[name="contacto"]').val();
    

    If you do need the class, it should be:

    input.clientenom[name="nivel"]
    

    or

    input[name="nivel"].clientenom
    

    EDIT: On a similar note, in most cases, there is no reason to do something like select#clienteslist.list. If the element has an ID just use the ID, unless there is some reason you only want to get it when it is a select and has the class list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.