Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > HTML Programming

HTML Programming Forum discussion covering HTML, XHTML, DHTML and all flavors of HTML. Hypertext Markup Language is used to create websites.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-16-2007, 03:38 PM
xsystemx xsystemx is offline
Newbie
 
Join Date: Sep 2007
Posts: 2
Rep Power: 0
xsystemx is on a distinguished road
Question Addition in html - Newbie question help plz !

Sidewinder | Please use [php], [code] and [highlight="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: The Forum Rules.

I am trying to write code that would allow me to have a list of products and it would be able to enter the amounts specified in boxes and give you the total once you press the total button....

I have pasted bellow what I have written so far... I am trying to figure out how to make it work... Please help me !

HTML4Strict Code:
  1.  
  2.  
  3. Product 1<INPUT type="text" name="A" value=""
  4.     onChange="A.value">
  5. Product 2<INPUT type="text" name="B" value=""
  6.     onChange="B.value">
  7.  
  8.  
  9. <input type="submit" value="Total"> &nbsp; <input name="answer" type="text" size="4" maxlength="10"
  10. onClick="document.calculator.ans.value+='A.value+B.value'">
  11.  
  12.     </p>
  13.  
  14. </body>
  15. </html>

Last edited by John; 09-17-2007 at 02:09 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 09-17-2007, 09:04 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,650
Last Blog:
PHP Objects, Patterns,...
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

You have no form name to start with:

HTML4Strict Code:
  1.  
  2. <form name="Calculator">
  3. Product 1<INPUT type="text" name="A" value=""
  4.     onChange="A.value">
  5. Product 2<INPUT type="text" name="B" value=""
  6.     onChange="B.value">
  7.  
  8.  
  9. <input type="submit" value="Total"> &nbsp; <input name="answer" type="text" size="4" maxlength="10"
  10. onClick="document.Calculator.answer.value=eval(document.Calculator.A.value+document.Calculator.B.value)">
  11.  
  12. </form>
  13.  
  14.     </p>
  15.  
  16. </body>
  17. </html>

That should work although I didn't test it.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!

Last edited by Jordan; 09-18-2007 at 01:22 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-18-2007, 12:33 PM
xsystemx xsystemx is offline
Newbie
 
Join Date: Sep 2007
Posts: 2
Rep Power: 0
xsystemx is on a distinguished road
Default Reply

Can you test it and possibly post your findings? I was unable to make it work...

xsystemx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



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

Advanced Search
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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
About HTML Onur Tutorials 0 08-28-2007 07:13 PM
Doubt re: interface LED with TMS320F2812 ?? Newbie question skn82 C and C++ 3 05-07-2007 12:04 PM
File I/O (newbie question) ntmurphy C and C++ 4 04-04-2007 03:30 AM
HTML Introduction clookid Tutorials 5 01-08-2007 10:43 PM
What is HTML, DHTML and XHTML? Lop HTML Programming 5 08-09-2006 12:00 PM


All times are GMT -5. The time now is 02:26 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads