Forum Moderators: open

Message Too Old, No Replies

How to print HTML form but hide the textboxes?

         

smagdy

9:02 am on Apr 25, 2005 (gmt 0)

10+ Year Member



So when I print a form it prints the text boxes ... So how to just print whats inside the boxes..

thanks in advance

ACJavascript

11:26 am on Apr 25, 2005 (gmt 0)

10+ Year Member



you could use a client-side scripting language or Server-side.

Client side would be:

Document.Write(document.yourform.yourtext.value);

Yourform would be the form the field is under.
Yourtext would be the "input" you want to show.

I think this is what you are looking for.

smagdy

11:36 am on Apr 25, 2005 (gmt 0)

10+ Year Member



but i wanna click the print button in the browser so it prints the page..

So I dont think ur solution would work...

benihana

11:40 am on Apr 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



use a print stylsheet:

<link rel="stylesheet" media="print" type="text/css" href="print.css">

in that stylesheet:

input, textarea {
border-width:0px;
}

smagdy

12:27 pm on Apr 25, 2005 (gmt 0)

10+ Year Member



Thanks it worked but ive another question..

Its how to also hide the source path of the printed page..

its like its written down

[localhost...] 2005-04-25

so, any clues?

natty

12:41 pm on Apr 25, 2005 (gmt 0)

10+ Year Member



have you tried submitting the page to a script that parses it into the format you want?

that would be my option, short of the suggestion to have a print stylesheet.

smagdy

12:47 pm on Apr 25, 2005 (gmt 0)

10+ Year Member



but whats the command to disable printing the path?

natty

2:54 pm on Apr 25, 2005 (gmt 0)

10+ Year Member



doesnt that depend on the printing settings in the users browser.. - you know margins and urls and page numbers and the like..

you may be on to a loser there, if you are wanting to do things with that..
mbe im miles off

smagdy

9:59 am on May 2, 2005 (gmt 0)

10+ Year Member



Please someone tell me how to hide the small box of the "Select Menu" and also how to hide the page source path that is written bottom of the paper.

For the select I tried

select{
display:none;
}

so it hided it but also hided the content.. so i want the content..

any help appreciated..

chriswragg

11:49 am on May 2, 2005 (gmt 0)

10+ Year Member



I think what Natty said is correct.

The settings of page numbers and URLs that are printed on the page from the browser are under the users control and not the developers. In Firefox they are located in File, Page Setup, Header and Footer.

The coding in the webpage has no control over the margins, headers, footers on a printed page, as these are set in the browser itself. A far as I know there are no scripts which can change this.

Please correct me if I am wrong.

Chris