Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Reply
 
LinkBack Thread Tools Display Modes
Old 22-01-2012, 11:38 PM   #1 (permalink)
Alpha Geek
 
mohityadavx's Avatar
 
Join Date: Nov 2010
Location: Gurgaon (Delhi NCR)
Posts: 574
Default Website Problem


Well one of my friend is developing a website he knows decent HTML bit of css, javascript and php (he is learning them he is in his 1st year only). Now the thing is he made a php website created a form in it taking user input.

Suggest a way to accept data in a form and then we want after clicking submit that the page shows text with new values in it. Something like this:-

Code:
Form 1

Name ; __________
Address ; _____________
Class ; ___________

Output is like this and user can just print it.
Code:
                                      Your Info




My name is ___________. I hate pasta.
My address is ____________. Blah Blah.


I studied in class _________ in 2012.

Please tell how can we do so?

Well we finally solved it using echo.

However is there any way possible using javscript instead of php to do so.
__________________
XPS 15 | Infibeam Pi |LG P500 |GoGear SA52XX | Sony PS2 | Sony H55 | Sennheiser CX 180 , MX760

For Free Legal Documentation - Rent Agreement/RTI etc
KAGZAAT
www.bleedlaw.com For Law student & aspirant

Last edited by mohityadavx; 22-01-2012 at 07:25 PM. Reason: Changed the method.
mohityadavx is offline   Reply With Quote
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 23-01-2012, 01:55 AM   #2 (permalink)
BIOS Terminator
 
nims11's Avatar
 
Join Date: Apr 2008
Location: Ranchi
Posts: 816
Default Re: Website Problem

here is the code, it should be self-understood
Code:
<head>
<script type="text/javascript">
function foo()
{
var name=document.form1.text1.value;
var address=document.form1.text2.value;
var classx=document.form1.text3.value;
document.write("<center>Your Info</center><br /><br />");
document.write("My Name is "+name+". i Hate Pasta.<br />");
document.write("My Address is "+address+". Blah Blah<br />");
document.write("I studied in Class "+classx+" in 2012<br />");

}
</script>
</head>
<body>
<form name="form1">
Name :  <input type="text" name="text1" value="" /><br />
Address :  <input type="text" name="text2" value="" /><br />
Class :  <input type="text" name="text3" value="" /><br />
<input type="button" value="Submit" onClick="foo();" /><br />
</form>
</body>
__________________
Arch Linux is kind of a bonzai tree, over years u try new things, make small tweaks, and end up with a system that is unique, elegant, and does exactly what u designed it to do.
Hostapd : The Linux Way to create Virtual Wifi Access Point
My Blog
nims11 is online now   Reply With Quote
Old 23-01-2012, 04:05 PM   #3 (permalink)
Alpha Geek
 
mohityadavx's Avatar
 
Join Date: Nov 2010
Location: Gurgaon (Delhi NCR)
Posts: 574
Default Re: Website Problem

Quote:
Originally Posted by nims11 View Post
here is the code, it should be self-understood
Code:
<head>
<script type="text/javascript">
function foo()
{
var name=document.form1.text1.value;
var address=document.form1.text2.value;
var classx=document.form1.text3.value;
document.write("<center>Your Info</center><br /><br />");
document.write("My Name is "+name+". i Hate Pasta.<br />");
document.write("My Address is "+address+". Blah Blah<br />");
document.write("I studied in Class "+classx+" in 2012<br />");

}
</script>
</head>
<body>
<form name="form1">
Name :  <input type="text" name="text1" value="" /><br />
Address :  <input type="text" name="text2" value="" /><br />
Class :  <input type="text" name="text3" value="" /><br />
<input type="button" value="Submit" onClick="foo();" /><br />
</form>
</body>
Thanx !
__________________
XPS 15 | Infibeam Pi |LG P500 |GoGear SA52XX | Sony PS2 | Sony H55 | Sennheiser CX 180 , MX760

For Free Legal Documentation - Rent Agreement/RTI etc
KAGZAAT
www.bleedlaw.com For Law student & aspirant
mohityadavx is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:38 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2