I have a form on my website that requires the user to enter data. They are all single line text boxes.

At the bottom of the form I have two buttons, one for Print and one for Submit. The Print button just opens the print dialog box and allows them to print the current page (including the form that was filled out). The Submit button just brings them to a thank you page.

I have a couple questions. Using PHP, HTML, or a javascript...

Is there a way to make the boxes not print around the forms, for example, just have the text print without the box around it?

And also, when hitting the Print button, is there a way to make it hide both the Print and Submit buttons until the print dialog box is closed?

Thanks for you help.

I'm assume that you don't want border's around the inputs rather than around the form :- a form is a container for inputs, buttons etc; inputs are the individual 'fields' of a form.

Ok, to remove the border from an input; try this:

<input type="text" style="border-style:none;"/>
and for textareas:
<textarea style="border-style:none;"/>

if you want to disable borders for all inputs and textareas, add this to any applied CSS block:

input{
	border-style:none;
}

textarea{
	border-style:none;
}

that won't remove the background color from the inputs mind, you'll have to make them the same color as the page background. I don't know if it's possible to make them transparent; perhaps it is.

To 'hide' a button is relatively easy; but getting it to come back again might be difficult...

Try:

<input type="Submit" onclick="this.style.display = 'none';"/>

like I say, getting it to come back at the right time might be hard...

This article has been dead for over six months. Start a new discussion instead.