Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old July 26th, 2008, 07:34 AM   #1
New Member
 

Join Date: Jul 2008
Location: Watford
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 kartalovp is on a distinguished road
OnClick to return values on same page?

Hi guys,
I am brand new here and very junior in javascript.
I hope you will be able to help me.
I have been trying to produce a very basic calculator where the user enters certain numeric values in textfields, then I use javascript to carry out the calculations. I have had no problems constructing the calculation function in javascript, but when I call the function by clicking a button, the whole page reloads and I get the answer in a blank new page. What I can't figure out how to do is to display the result of the calculations at the bottom of the current page (where I collect the data from the users), keeping the textfields as they are just adding the whatever the function returns at the bottom of teh page.

I hope you can give me direction on this.
Thanks a lot,
Peter

Last edited by Aso; July 28th, 2008 at 04:15 PM.. Reason: Moved to JavaScript Forum
kartalovp is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old August 1st, 2008, 09:25 AM   #2
New Member
 

Join Date: Aug 2008
Location: MK
Posts: 35
Thanks: 0
Thanked 5 Times in 5 Posts
Rep Altering Power: 0 leoludwig is on a distinguished road
Re: OnClick to return values on same page?

You could add a field with an id and get your function to write the result in that field. Also make sure that your input type is not submit but button otherwise it will post the page.
leoludwig is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
need to onclick to open info in div on same page apster JavaScript 2 April 30th, 2007 05:56 AM
Setting Form Values to Previously Entered Values masonbarge PHP 6 October 17th, 2006 01:36 PM
Query question - can I return values for records not found? Donny Bahama Databases 5 August 21st, 2006 07:39 AM
Assign string values to integer values of a session variable Andy K Classic ASP 1 July 13th, 2005 04:29 AM
return from db benbramz Classic ASP 5 June 19th, 2005 02:29 PM


Search Engine Optimization by vBSEO 3.2.0 RC8