943,985 Members | Top Members by Rank

Ad:
Jan 30th, 2007
0

Stop printing boxes around forms?

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
mindfrost82 is offline Offline
38 posts
since Dec 2004
Jan 30th, 2007
0

Re: Stop printing boxes around forms?

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:

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <input type="text" style="border-style:none;"/>
  2. and for textareas:
  3. <textarea style="border-style:none;"/>

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

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. input{
  2. border-style:none;
  3. }
  4.  
  5. textarea{
  6. border-style:none;
  7. }

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:

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <input type="Submit" onclick="this.style.display = 'none';"/>

like I say, getting it to come back at the right time might be hard...
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
MattEvans is offline Offline
1,091 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Help with my Navigation bar
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Datatable and AJAX





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC