473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Creating a field that cannot be edited throuh the ui form itself

Hi

I want to create fileds on my form that can not be manually edited
through the UI of the form. Instead the (visible) content is changed
through changes on other parts of the form.
e.g. making a selection from a list changes the content of the field
mentioned above.
I don't know the html code to create such a field on my form. Can
anyone help me out?

Regards

Jul 23 '05 #1
5 1753
"Lando Chez" <go********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hi

I want to create fileds on my form that can not be manually edited
through the UI of the form. Instead the (visible) content is changed
through changes on other parts of the form.
e.g. making a selection from a list changes the content of the field
mentioned above.
I don't know the html code to create such a field on my form. Can
anyone help me out?


<form name="myForm">
<input type="text"
name="readonlyInput"
value="The value"
defaultvalue="The value"
readonly="readonly"
onchange="this.value=this.defaultValue;">
</form>

The real problem is that this still does not guarantee that the end-user
can not change the content of this input. As a result, you can NOT
depend on the value in this input when it reaches the server. For
example, if you are calculating a total price based on unit price times
the number of units, you should re-calculate that on the server, even if
you are putting it the above readonly input for the benefit of the
end-user.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
Lando Chez wrote:
Hi

I want to create fileds on my form that can not be manually edited
through the UI of the form. Instead the (visible) content is changed
through changes on other parts of the form.
e.g. making a selection from a list changes the content of the field
mentioned above.
I don't know the html code to create such a field on my form. Can
anyone help me out?

Regards


<input readonly>

Mick
Jul 23 '05 #3
Hi

Thank you for responding. Is it possible to show the content as a lable
instead of a visible textfield box? So actually showing the content as
if it is a normal text on a form?

Jul 23 '05 #4
Lando Chez wrote:
Hi

Thank you for responding. Is it possible to show the content as a lable
instead of a visible textfield box? So actually showing the content as
if it is a normal text on a form?


<input...style="border-width:0;">

Jul 23 '05 #5
"Lando Chez" <go********@hotmail.com> kirjoitti
viestissä:11*********************@o13g2000cwo.goog legroups.com...
Hi

Thank you for responding. Is it possible to show the content as a lable
instead of a visible textfield box? So actually showing the content as
if it is a normal text on a form?


Here's one way:

<span id="fred_flintstone">old value</span>
<script>
document.getElementById("fred_flintstone").innerHT ML = "here's the new
value";
</script>

Doing it like this, the span IS a normal text on the form, but you can
manipulate the contents of it via innerHTML.

--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears

et****************@5P4Mgmail.com
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Iain Miller | last post by:
Now this shouldn't be hard but I've been struggling on the best way as to how to do this one for a day or 3 so I thought I'd ask the assembled company..... I'm writing an application that tracks...
2
by: Galina | last post by:
Hello I have an application in MS Access 2000. I have a form, which includes a subform. The subform is based on a table, but locked for any editing. There is Edit button. When clicked, it starts a...
5
by: F. Barth | last post by:
Hello, I've posted this problem to one other newsgroups, and gotten some diagnostic help, but I still need a solution. The full text of the message box is: "The field is too small to accept the...
10
by: Deano | last post by:
I think that just about sums it up. Is there a fix/workaround for this?It's quite annoying behaviour and not user-friendly.thanksMartin
8
by: Mark | last post by:
When my form goes to a new record, I have a procedure that copies the last record added to the form's underlying table into the form. The intent is that a series of new records may have the same...
2
by: Uwe Range | last post by:
Hi to all, I am working on a form with a combi-field on a subform. I want to give the user the opportunity to alter the list-content (which is based on a table) in a separate form. The user...
1
by: Hozi | last post by:
I am getting the below error when asp.net tries to parse the .aspx file. The funny part is that the error only seems to be happening when viewing the page throuh IE 6 and not Netscape browsers. I...
8
by: Oenone | last post by:
Is it possible to create an object which can have methods and properties, but which can also be treated as a string? I'm trying to create a wrapper around the IIS Request.Form object which...
7
by: grummanf6f | last post by:
Hello Gurus, this probably is real simple for you but for me it's a bummer. I have one table in which I have basic data collected of schools. I have another data that is detailed info on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.