页面加载后SPAN文本消失 [英] SPAN text disappears after page load

查看:144
本文介绍了页面加载后SPAN文本消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨世界:)我的页面中有一个SPAN,它将根据我在下拉菜单中的选择更改其文本。每当我更改下拉列表中的值时,跨度值将根据我在下拉列表中选择的值进行更改。但是,该值仅显示2-3秒(即仅在页面加载期间),并且在页面加载后,SPAN文本变为空白。即使在页面加载后也不确定如何保留范围文本。请帮我解决这个问题。





先谢谢你们,祝你们度过美好的一天:)

Hi World :) I have a SPAN in my page which will change its text based on the selection I do in dropdown. Whenever I change the value in dropdown the span value gets changed based on the value I selected in dropdown, However the value appears only for 2-3 seconds (i.e only during page loading) and after page loading the SPAN text is getting blank. Not sure how to retain the span text even after page loading. please help me to overcome this issue.


Thanks in Advance and have a great day all :)

推荐答案

我认为这个问题可能与Mozilla Firefox有关。我遇到了同样的问题。我通过将Span转换为Div解决了这个问题,



span.Content由div.InnerHTML替换
I think this problem might be with the Mozilla Firefox. I had Came Across Same Issue. I had Solved this issue by converting Span To Div,

span.Content replaced by div.InnerHTML


嗨Guys,之后做了一些研究和一些自我测试我找到了解决方案。

由于页面在点击提交按钮后加载页面,SPAN值将被清除。所以我从我的Javascript函数返回false。那是



Hi Guys, after doing some research and some self testing I have found the solution for this.
Since the page is getting page load after the click of submit button, the SPAN value is getting cleared. So i have returned false from my Javascript function. That is

var errormessagespan = document.getElementById('<=errorMessageSpan.ClientID>');
 if (textbox.value == "") {
 errormessagespan.innerHTML = "please enter the value for textbox1";
 return false;
 }







我已点击提交按钮on



< input type =submitvalue =提交runat =serverdisabled =disabledönclick=return validateTextbox()id =submitButton/>





现在SPAN值正确显示,不再被清除。



感谢您抽出宝贵时间,如果您觉得它适合您,请接受我的解决方案。

祝您有个美好的一天:)




and i have given my submit button onclick as

<input type="submit" value="Submit" runat="server" disabled="disabled" önclick=" return validateTextbox()" id="submitButton" />


Now the SPAN value is getting displayed properly and no more its getting cleared.

Thanks for putting your time and please do accept my solution if you feel it works fine for you.
Have a great day world :)


这篇关于页面加载后SPAN文本消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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