DIV标签不显示来自onblur的文本 [英] DIV tags don't show text from onblur

查看:88
本文介绍了DIV标签不显示来自onblur的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我完全失去了!我已经尝试了几天让Onblur填写这个城市,在用户在文本框中输入一个5位数的邮政编码后,从我想要提取信息的邮政编码,城市,州文本框输入状态在这样一个单独的行:

a)用户输入一个邮政编码:95051

b)Onblur填写城市和州

c)新的一行显示前的同一页面。

支持服务

SantaClara,CA 95051


我在这里加载了所有代码的测试页面:http:// www.echildcaremanagement.com/prototype/step6.html


HTML代码:

I''m totally lost! I''ve been trying for several days to make Onblur fill in the city, state after the user inputs inside a textbox a 5 digit zip code, from the the zip, city, state text boxes I want to extract the info and pu it in a separate line like this:
a) user puts a zipcode:95051
b) Onblur fills in city and state
c) a new line in the same page showing ex.
Support Services
SantaClara,CA 95051

I have a test page loaded with all the code here: http://www.echildcaremanagement.com/prototype/step6.html

The HTML code:

展开 | 选择 | Wrap | 行号

推荐答案

嗨...


你文档中div的唯一ID(你想要输出的地方?)是''city1'',但是在handleHttpResponse中你尝试getElementById(''city'')等等,所以你会得到一个错误,你的元素找不到ts ...将所有div中的正确ID放在您的文档中,或者将所有尝试获取不可用ID的行取消注释用于测试目的......所以:您的问题是ID! ;)


亲切的问候
hi ...

the only id of a div (where you want the output?) that you have in your document is ''city1'' but in handleHttpResponse you try to getElementById(''city'') etc. so you will get an error that your elements are not found ... put all divs with the correct ids in your document, or outcomment all lines that try to get an unavailable id for testing purposes ... so: your problem are the ids! ;)

kind regards



hi ...


div中唯一的id(你想要输出的地方?)你文件中有''city1'',但是在handleHttpResponse中你尝试getElementById(''city'')等等所以你会得到一个错误,你的元素没有被找到...把所有div都放在你的文档中正确的id,或者取消注释所有尝试获取不可用id以用于测试目的的行......所以:你的问题是ids! ;)


亲切的问候
hi ...

the only id of a div (where you want the output?) that you have in your document is ''city1'' but in handleHttpResponse you try to getElementById(''city'') etc. so you will get an error that your elements are not found ... put all divs with the correct ids in your document, or outcomment all lines that try to get an unavailable id for testing purposes ... so: your problem are the ids! ;)

kind regards



但我正试图在文本框中获取拉链,城市和州信息在那里我想提取那些信息并把它放在另一行,如果我要删除handleHttpResponse你尝试getElementById(''city'')那么什么都行不通!在DIV上我想要的就是能够从城市,州和邮政编码输出一次onblur更新文本框,但我想把信息保存在文本框中..我希望这很清楚吗? br />

我需要能够展示的是当有人输入拉链编号时,城市和州内的Onblur就是这样!从那里我想能够把它放在这样的地方:支持服务一条线,Santa Clara,CA 95051 seconde线,致电408-445-4573第三线。


谢谢很多!


Ed

But I''m trying to get zip, city and state info inside the textboxes from there I want to extract that information and put it in another line, if I was to remove handleHttpResponse you try to getElementById(''city'') then nothing works! on the DIV all I want in there is to be able to have the output from the city, state and zipcode once onblur updates the textbox, but I wan to keep the information also inside the textboxes.. I hope this is clear enough?

All I need to be able to show is when someone enters a zip number the city and state with Onblur which it does! from there i want to be able to put it somewhere like this: Support Services one line, Santa Clara, CA 95051 seconde line, call 408-445-4573 third line.

Thanks a lot!

Ed


在firefox的帮助下我能够让你的代码正常运行...修复:


u正在使用命令getElementById;但你使用name属性而不是id。


ie:

[HTML]< input type =" text"大小= QUOT; 2英寸命名= QUOT;状态" ID = QUOT; STATE1" /> [/ HTML]
with some help from firefox i was able to get your code working...fixes:

u are using the command "getElementById" but your using the name attribute instead of the id.

ie:
[HTML]<input type="text" size="2" name="state" id="state1" />[/HTML]
展开 | 选择 | Wrap | 行号


这篇关于DIV标签不显示来自onblur的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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