没有定义addInput? [英] not defined addInput?

查看:149
本文介绍了没有定义addInput?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿所有人,


我继续得到addInput未定义但我无法弄清楚它有什么问题的错误。当我使用它提交数据时,它工作得非常好。但现在我试图让它显示以前输入的数据,它表示没有定义addInput。真的可以使用一个想法,因为我不能理解它。


这里是我有的东西


javascript

Hey Everyone,

Well i keep getting the error that addInput is not defined but i can not figure out what is wrong with it. It worked perfectly fine when i was using it to submit data. But now that i am trying to make it display previously entered data it says addInput is not defined. could really use an idea on whats wrong with it because i can''t figure it out.

here is what i have

javascript

展开 | 选择 | Wrap | 行号

推荐答案

在第59行中,您尝试将新创建的div附加到另一个元素,一个元素id为动态。我在你的代码中的任何地方都没有看到这个标签。


你可以改变参考,硬编码dynamicInput相反。


如果函数本身不起作用,但是在启动时没有看到任何错误,请检查构建新div的.innerHTML的长字符串。

编辑好吧,你的字符串很好,整体功能也很好(好吧,很好:也许,语法错误:是的) 。


是您在文档头部发布的脚本块,还是在外部文件中?

如果它在外部文件,删除开头和结尾的实际脚本标记代码。
in line 59 you try to append the newly created div to another element, an element with the id "dynamic". i don''t see this tag anywhere in your code.

you could change the reference, and hard code "dynamicInput" instead.

if the function itself is not working, but you are not seeing any errors upon boot, check the long string that build the new div''s .innerHTML for breaks.

EDIT: ok, your string is fine, as is the function overall (well, fine: maybe, syntax-error-free: yes).

is the script block you posted in the document''s head, or is it in an external file?
if it''s in an external files, remove the actual script tag code at the start and end.


第59行中的
您尝试将新创建的div附加到另一个element,id为dynamic的元素。我在你的代码中的任何地方都没有看到这个标签。


你可以改变参考,硬编码dynamicInput相反。


如果函数本身不起作用,但是在启动时没有看到任何错误,请检查构建新div的.innerHTML的长字符串。

编辑好吧,你的字符串很好,整体功能也很好(好吧,很好:也许,语法错误:是的) 。


是您在文档头部发布的脚本块,还是在外部文件中?

如果它在外部文件,删除开头和结尾的实际脚本标记代码。
in line 59 you try to append the newly created div to another element, an element with the id "dynamic". i don''t see this tag anywhere in your code.

you could change the reference, and hard code "dynamicInput" instead.

if the function itself is not working, but you are not seeing any errors upon boot, check the long string that build the new div''s .innerHTML for breaks.

EDIT: ok, your string is fine, as is the function overall (well, fine: maybe, syntax-error-free: yes).

is the script block you posted in the document''s head, or is it in an external file?
if it''s in an external files, remove the actual script tag code at the start and end.



嘿嘿我,


感谢您的回复。该脚本位于我文件的文档中。如果您正在使用它来插入信息,这确实可以正常工作,没有错误,但我不想在我可以编辑以前输入的信息的地方,现在我得到它的错误。


我想要做的是我用这个来插入信息,现在我想把它用在哪里我可以用它来编辑信息。我遇到的第一个问题是,当我加载页面时,除了添加更多序列号的按钮之外没有任何其他内容。当我在页面加载第一个要填写的序列号时插入信息时出现a然后按钮出现在下面以添加更多。现在我试图显示以前输入的信息,除了按钮之外页面加载时没有任何内容出现。如果你点击按钮然后它会显示你填写的序列号,每次你点击添加时它会继续向你显示同一个,我只是想显示之前输入的内容,他们也必须能够添加更多序列号。但是现在只是试图让它显示表格出现时填写的连续剧,但我不知道如何去做。我知道错误来自你提到的那条线,它在身体标签上的onload有问题。但是如果你有任何建议去做这件事我会非常感激它


感谢您的帮助:),

Rach

Hey rnd me,

Thank you for your response. The script is in the documents head in my file. An this does work correctly with no errors if your are using it to insert information, but i am not trying to make it where i can edit previously entered information an now i am getting errors with it.

What i am trying to do is i used this to insert information and now i am trying to make it where i can use it to edit the information. The first problem i am running into is when i load the page nothing appears except the button to add more serial numbers. When i am inserting the information when the page loads the first serial number to fill out appears an then the button appears below to add more.Now that i am trying to display previously entered information nothing appears when the page loads except the button. If you click the button then it will show you the serial number you filled out, an it will continue to show you the same one every time you click add, i am only trying to show what was entered before and they also have to be able to add more serial numbers to it. But right now just trying to get it to display the serials filled out when the form appears but i have no clue how to go about this. I know that the errors come from the line you mentioned an its been having a trouble with the onload in the body tag.But if you have any suggestions to go about this i would very much appreciate it

Thank you for the help :),
Rach


如果要将其称为onload,请将''dynamic''更改为''dynamicInput ''调用addInput()。
If you want to call it onload, change the ''dynamic'' to ''dynamicInput'' when calling addInput().


这篇关于没有定义addInput?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆