简体   繁体   English

我正在尝试记录提交按钮表单的元素,但在控制台浏览器中看不到任何内容

[英]I am trying to log the elements of my submit buttons form but it I cannot see anything in the console browser

I am trying to log the elements of my submit buttons form but it I cannot see anything in the console browser.我正在尝试记录提交按钮表单的元素,但在控制台浏览器中看不到任何内容。

 $("#signupform").submit(function(event){
        //prevented default php processing
        event.preventDefault();
        //collect user inputs
        event.preventDefault();
        var datatopost = $(this).serializeArray();
        console.log(datatopost);
        

    });

I finally did it by changing the event from submit to click here it is:我终于通过将事件从提交更改为单击此处来做到这一点:

$('#signupform').click(function(e){
    e.preventDefault();
   var datatopost= $(this).serializeArray();
   console.log(datatopost);

})

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我在浏览器中看不到任何内容? - Why I am unable to see anything in the browser? 当我尝试在表单中添加新元素时,Symfony2表单在提交时变得无效 - Symfony2 Form becomes invalid on submit when I am trying to append new elements in form 我正在尝试用 javascript 编写一个 while 循环。 我的 console.log 没有打印请求的消息 - I am trying to write a while loop in javascript. My console.log does not print the requested message 我在我的谷歌浏览器开发者工具控制台中看不到 console.log 消息。 任何想法为什么? - I cannot see the console.log messages in my google chrome developer tool console. Any ideas why? 如您所见,我正在尝试创建链接元素? - As you can see I am trying to create a link elements? 如何在Chrome浏览器控制台中提交带有输入值的表单? - How can I submit a form with input values in Chrome browser console? 我在浏览器控制台中看不到 react lint 错误 - I can't see react lint errors in my browser console 我得到一个JSON / Javascript对象是因为可以在控制台中看到它,但是如何获取它进行序列化并使数据绑定到Ui元素呢? - I am getting a JSON/Javascript object because I can see it in my console, but how do I get it to serialize and make my data bind to my Ui elements? 我试图找出为什么当我运行以下代码时,单选按钮的值显示在控制台上而不显示在浏览器上的原因? - I am trying to find out why my value for the radio button is shown on the console but not on the browser when I run the following code? 我有1个表单和2个提交按钮 - I have 1 form with 2 submit buttons
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM