Solved

Prevent form field from being modified

Posted on 1997-07-09
1
225 Views
Last Modified: 2006-11-17
I'm relatively new to Javascript, and I've managed to create a "calculator". The thing though is that the only method I know of to display results is in a TEXT field in a FORM. My problem is that it is possible for the user to go into these text fields and edit the results (for whatever reason) and may cause some confusion. So I would like to know if there is a way to prevent the field from being modified (no, not willing to do something like send the values to the fields every half a second). If not, then is there any other way to display answers in an object other than a text field in a form?? If you would like clarification of what I'm talking about look at it at: http://courses.bus.ualberta.ca/mgtsc352/2_5_clc6.htm
The only thing the user is supposed to modify is the field beside "SMOOTH".  Thank you!
0
Comment
Question by:leekk
1 Comment
 
LVL 5

Accepted Solution

by:
icd earned 70 total points
ID: 1268395
Change each of the input boxes that you calculate to (for example)

<td><input type="text" name="f2" size=4 OnBlur="compute(this.form)"></td>

Then as soon as the cursor is moved off the field any changes are recomputed.

Of course it will not change it back until the cursor moves off the field but then no other solution will either.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now