打印时隐藏文本框 [英] hide text box when print

查看:131
本文介绍了打印时隐藏文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

i使用php来设计网站,但是我遇到了打印问题。

在一个页面我有按钮和文本框,我想当我按下文本框消失的按钮。

hello,
i use php to design website , but i faced problem in printing.
in one page i have button and text box , i want when i press on the button the text box disappear.

推荐答案

基于稍微不足的描述:



如果你'单击按钮时,在客户端重新工作。一旦你在客户端,最简单的控制是通过javaScript:给你的文本框一个ID并设置它的visibility ='hidden';当您的打印事件通过时(或在适当的时候),使用visibility ='visible'恢复;



如果打印在服务器上调用php,则可以在会话变量(例如)中捕获文本框的内容,然后通过AJAX使其消失。然后,您可以通过多种方式恢复文本框(甚至刷新页面)并从会话变量恢复文本。



这一切都取决于你在做什么打印。
Based upon the somewhat scanty description:

If you're working on the client side when you click the button. Once you are at the client, the easiest control is via javaScript: give your textbox an ID and set it's visibility='hidden'; when your print event is through (or whenever it is appropriate), restore with visibility='visible';

If the printing is calling php on the server, you can capture the contents of the textbox in a session variable (for example) and then make it go away via AJAX. Then, you restore the textbox in any number of ways (even refreshing the page) and restore the text from the session variable.

It all depends upon what you are doing to print.


这篇关于打印时隐藏文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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