Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 04-04-07   #1 (permalink)
*cough* Stock *cough*
 
chobes's Avatar
 
intel nvidia

Join Date: Jan 2007
Posts: 260

Rep: 7 chobes Unknown
Unique Rep: 7
Trader Rating: 0
Default javascript help...input page display to info page

how would i make an info page with a bunch of text input boxes and once submitted show the values on a different page as like a confirmation type of thing..

im doing a project at school where i have to make a business card generator and on the first page the user inputs info into text boxes then submit, after it displays a template of it using the info on the previous "text box" page

thanks so much guys\girls!

+rep for help!!
__________________
Is Cisco a cooking ingredient?

System: Mugen
CPU
e6600 3.4ghz @ 1.4v
Motherboard
Gigabyte 965p-DS3 Rev. 3.3
Memory
2g Mushkin 4-5-4-11
Graphics Card
EvGA 8800 GTS Superclocked 320
Hard Drive
250g Seagate Baracuda
Sound Card
on board
Power Supply
600 OCZ GameXstream
Case
Silverstone TJ-09
CPU cooling
Thermalright Ultra-120
OS
XP Pro
Monitor
Samsung 19 ws
chobes is offline   Reply With Quote
Old 04-04-07   #2 (permalink)
*cough* Stock *cough*
 
chobes's Avatar
 
intel nvidia

Join Date: Jan 2007
Posts: 260

Rep: 7 chobes Unknown
Unique Rep: 7
Trader Rating: 0
Default

bump
__________________
Is Cisco a cooking ingredient?

System: Mugen
CPU
e6600 3.4ghz @ 1.4v
Motherboard
Gigabyte 965p-DS3 Rev. 3.3
Memory
2g Mushkin 4-5-4-11
Graphics Card
EvGA 8800 GTS Superclocked 320
Hard Drive
250g Seagate Baracuda
Sound Card
on board
Power Supply
600 OCZ GameXstream
Case
Silverstone TJ-09
CPU cooling
Thermalright Ultra-120
OS
XP Pro
Monitor
Samsung 19 ws
chobes is offline   Reply With Quote
Old 04-05-07   #3 (permalink)
110100001101001111000
 
C-bro's Avatar
 
intel nvidia

Join Date: Jan 2006
Location: Hamilton, ON
Posts: 1,832

Rep: 283 C-bro is a proven memberC-bro is a proven memberC-bro is a proven member
Unique Rep: 215
FAQs Submitted: 6
Folding Team Rank: 237
Hardware Reviews: 9
Trader Rating: 1
Default

The simple answer? Download Netbeans. I took the time a while back to learn alot of the Swing API for text boxes and buttons and all that jazz. However, Netbeans incorporates a WYSWYG editor where you just drag and drop all the buttons/controls onto a panel or container and it generates the code automatically. You can then specify your own action events (for generating a popup with the data for example). I'm pretty sure you can do the same with Javascript projects as well.

System: RAID0R
CPU
Intel E2180 3.33GHz
Motherboard
Asus P5K-E/WIFI-AP vMod
Memory
2GB Kingmax DDR2-1066
Graphics Card
EVGA 8800GT
Hard Drive
2x250GB WD+500GB 7200.11
Sound Card
SB Audigy 2
Power Supply
Corsair CMPSU-550VX
CPU cooling
Arctic Cooling Freezer 7 Pro
GPU cooling
Zalman VF900-Cu
OS
Windows Vista Business 32-Bit
Monitor
HP F2105 21" & Samsung 712N
C-bro is offline I fold for Overclock.net Overclocked Account C-bro's Gallery   Reply With Quote
Old 04-05-07   #4 (permalink)
Programmer
 
stupid's Avatar
 
amd nvidia

Join Date: Jan 2006
Location: Fahaheel, Kuwait
Posts: 1,239

Rep: 147 stupid is acknowledged by manystupid is acknowledged by many
Unique Rep: 116
FAQs Submitted: 1
Trader Rating: 4
Default

Quote:
Originally Posted by C-bro View Post
The simple answer? Download Netbeans. I took the time a while back to learn alot of the Swing API for text boxes and buttons and all that jazz. However, Netbeans incorporates a WYSWYG editor where you just drag and drop all the buttons/controls onto a panel or container and it generates the code automatically. You can then specify your own action events (for generating a popup with the data for example). I'm pretty sure you can do the same with Javascript projects as well.
I am not sure if that will hold true at all, there is basically no relation between Java and JavaScript other than the name:
http://www.htmlgoodies.com/beyond/ja...le.php/3470971

Can you do it with a server side language like php or ASP? It would be a lot easier.

If not, I just have to shake the rust out and think through some Javascript.
__________________
"If there is a god, I hope he has a good excuse"
Woody Allen

System: Minazo
CPU
Opteron 1210
Motherboard
Biostar TForce 550 SE
Memory
2x1GB G.Skill DDR2 800
Graphics Card
eVGA 8800GT
Hard Drive
500GB 16MB Buf Samsung
Power Supply
Corsair HX520W Modular
Case
CoolerMaster Centurion 5
CPU cooling
CoolerMaster GeminII & Scythe SFF21Ds
GPU cooling
Accelero S1 & Scythe SFF21D
OS
XP Pro SP2
Monitor
Dual monitors: 22" & 19" Widescreens
stupid is offline   Reply With Quote
Old 04-05-07   #5 (permalink)
Programmer
 
stupid's Avatar
 
amd nvidia

Join Date: Jan 2006
Location: Fahaheel, Kuwait
Posts: 1,239

Rep: 147 stupid is acknowledged by manystupid is acknowledged by many
Unique Rep: 116
FAQs Submitted: 1
Trader Rating: 4
Default here you go

Here's a ghetto barebone example with as little JS as possible. There is no validation/error checking or anything, but this should give you the basic idea:

PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" >
<
head>
  <
title>JS test</title>
  <
style type="text/css">
    
div.border {border:solid 1px black;padding:5px;margin:5px;}
    
a{text-decoration:none;font-weight:bold;}
  </
style>
  <
script language="javascript" type="text/javascript">
    function 
run(){
      
document.getElementById("output").innerHTML document.getElementById("company").value "<br /><br />";
      
document.getElementById("output").innerHTML += "<div style=margin-left:100px;>" document.getElementById("name").value "</div>";
      
document.getElementById("output").innerHTML += "<div style=margin-left:100px;>" document.getElementById("name").value "@" document.getElementById("company").value ".com</div>";
    }
  
</script>
</head>
<body>
<form id="form1">
  <div style="width:300px;" class="border">
    INPUT:
      <div class="border">
        Name:
        <input id="name" type="text" />
        <br />
        Company:
        <input id="company" type="text" />
        <br />
        <a href="#" onclick="run()">SUBMIT</a>
      </div>
    OUTPUT:
    <div id="output" class="border"></div>
  </div>
</form>
</body>
</html> 
Basically make sure you id (not 'name' anymore) all of the elements in your html you want to work with and then you can use the document.getElementByName() tag. Once you can pull the values, just stick them into the .innerHTML of whatever you want to fill. But remember, if you set the innerHTML equla to something, it will COMPLETELY replace everything you have in there already, += will append it to the end of where the innerHTML left off.

Basically all of the work goes into formatting in the JS.

Let me know if that explains it well enough.
__________________
"If there is a god, I hope he has a good excuse"
Woody Allen

System: Minazo
CPU
Opteron 1210
Motherboard
Biostar TForce 550 SE
Memory
2x1GB G.Skill DDR2 800
Graphics Card
eVGA 8800GT
Hard Drive
500GB 16MB Buf Samsung
Power Supply
Corsair HX520W Modular
Case
CoolerMaster Centurion 5
CPU cooling
CoolerMaster GeminII & Scythe SFF21Ds
GPU cooling
Accelero S1 & Scythe SFF21D
OS
XP Pro SP2
Monitor
Dual monitors: 22" & 19" Widescreens
stupid is offline   Reply With Quote
Old 04-09-07   #6 (permalink)
*cough* Stock *cough*
 
chobes's Avatar
 
intel nvidia

Join Date: Jan 2007
Posts: 260

Rep: 7 chobes Unknown
Unique Rep: 7
Trader Rating: 0
Default

thanks guys... too bad my assignment was already due!! i had a url example with question marks in the url to pass variables but it never worked if i viewed the site locally.. luckilly my teacher knew it would work on a server so i passed =) but thanks for the input guys!!
__________________
Is Cisco a cooking ingredient?

System: Mugen
CPU
e6600 3.4ghz @ 1.4v
Motherboard
Gigabyte 965p-DS3 Rev. 3.3
Memory
2g Mushkin 4-5-4-11
Graphics Card
EvGA 8800 GTS Superclocked 320
Hard Drive
250g Seagate Baracuda
Sound Card
on board
Power Supply
600 OCZ GameXstream
Case
Silverstone TJ-09
CPU cooling
Thermalright Ultra-120
OS
XP Pro
Monitor
Samsung 19 ws
chobes is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 10:39 PM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.29753 seconds with 8 queries