User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 423,499 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,679 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 863 | Replies: 7
Reply
Join Date: May 2008
Posts: 47
Reputation: pranav_jog is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
pranav_jog pranav_jog is offline Offline
Light Poster

print html form

  #1  
Jun 18th, 2008
how to print html form directly.
i.e is there any programatic way or is there any tag to print html form
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2008
Location: Hyderabad, India
Posts: 261
Reputation: sreein1986 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 30
sreein1986's Avatar
sreein1986 sreein1986 is offline Offline
Posting Whiz in Training

Re: print html form

  #2  
Jun 18th, 2008
I think it on dynamic page
Thanx,
Sreekanth

www.saap.in
if you problem solved add me as a reputation and mark it mark as solved
Reply With Quote  
Join Date: May 2008
Posts: 47
Reputation: pranav_jog is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
pranav_jog pranav_jog is offline Offline
Light Poster

Re: print html form

  #3  
Jun 18th, 2008
but how to do it in programatic way??? is there any code to print the page???



Originally Posted by sreein1986 View Post
I think it on dynamic page
Reply With Quote  
Join Date: May 2008
Posts: 47
Reputation: pranav_jog is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
pranav_jog pranav_jog is offline Offline
Light Poster

Re: print html form

  #4  
Jun 19th, 2008
but how to do it in programatic way??? is there any code to print the page???




Originally Posted by sreein1986 View Post
I think it on dynamic page
Reply With Quote  
Join Date: May 2008
Location: Hyderabad, India
Posts: 261
Reputation: sreein1986 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 30
sreein1986's Avatar
sreein1986 sreein1986 is offline Offline
Posting Whiz in Training

Re: print html form

  #5  
Jun 19th, 2008
please the post this thread in ASP or ASP.net forum
They will Answer
Thanx,
Sreekanth

www.saap.in
if you problem solved add me as a reputation and mark it mark as solved
Reply With Quote  
Join Date: Jun 2007
Posts: 179
Reputation: macneato is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 13
macneato's Avatar
macneato macneato is offline Offline
Junior Poster

I Know I'm posting in the wrong section - But there is quite a bit of HTML here

  #6  
Jun 19th, 2008
Hi Pranav,

I don't quite understand. Would you like the form to be printed onscreen?

If so (Im going to use php to do this) here is what we will do.

Simple HTML form:

<form id="form1" name="form1" method="post" action="mail.php">
  <p>Name 
    <input name="visitor" type="text" id="visitor" />
</p>
  <p>Email
    <input name="visitormail" type="text" id="visitormail" />
</p>
  <p>Message 
    <textarea name="notes"></textarea>
  </p>
</form>

Then comes the PHP

I'm going to explain it, then give you the complete code.

Alright so first we assign varibles.
<?php
$name = $_POST['visitor']; 
$email = $_POST['visitormail']; 
$msg = $_POST['notes'];
?>

Hope you see what I'm doing here, basically we giving our textareas/boxs names to be called by.

next we will want to print it onscreen. To Accomplish this. We will use the ECHO command, then call the varibles we assigned.

Read below:

<p align="center">
Thank You : <?php echo $name ?> ( <?php echo $email ?> ) 
<br /> 
Message:<br /> 
<?php $notesout = str_replace("\r", "<br/>", $notes); 
echo $notesout; ?> 
<br /><br />
<a href="index.html"> Home </a></p>

Notice we using Html? and only php to fill in the blanks.

Your complete code would look like this:

<?php
$name = $_POST['visitor']; 
$email = $_POST['visitormail']; 
$msg = $_POST['notes'];
?>
<p align="center">
Thank You : <?php echo $name ?> ( <?php echo $email ?> ) 
<br /> 
Message:<br /> 
<?php $notesout = str_replace("\r", "<br/>", $notes); 
echo $notesout; ?> 
<br /><br />
<a href="index.html"> Home </a></p>

Done! Remeber to name the php section of the code mail.php (if you following this tutorial, if not, just name it to anything you assigned your form action to)

If you need any more assistance, just ask.

Regards,
If this reply solved your problem, please add to my reputation and don't forget to mark this thread as solved.
Reply With Quote  
Join Date: May 2008
Posts: 47
Reputation: pranav_jog is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
pranav_jog pranav_jog is offline Offline
Light Poster

Re: print html file

  #7  
Jul 15th, 2008
whenever user clicks the print button on html file, then the data in html will be printed, i'e it will directly go to printer for printing.
how to do this in html??
Reply With Quote  
Join Date: Jul 2008
Location: Sweet India
Posts: 807
Reputation: Shanti Chepuru is on a distinguished road 
Rep Power: 2
Solved Threads: 71
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Practically a Posting Shark

Re: print html form

  #8  
Jul 15th, 2008
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb HTML and CSS Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 4:13 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC