This topic is locked

edit box

6/7/2008 6:24:10 AM
PHPRunner General questions
G
garethp authorDevClub member

Hi
I have a javascript that calculates a field value automatically on the add/edit screen. As I do not want the user to be able to edit this I have used the code...
document.forms.editform.value_pipefill.disabled=true;
to make read only. This works great other than when on the add/edit page this field has a box round it - whereas with the normal way of making a field read only there is no box.
Is there any way I can remove this box from around the field?
Thanks
Gareth

J
Jane 6/9/2008

Gareth,
unfortunately it's impossible.

Readonly value is just a plain text, you can't change readonly value in the JavaScript code.

D
Dale 6/12/2008

Im not sure if Im completely off the mark here but I think this is more than doable.

I would dynamically change the class of the element and you should be able to get a look you want.

I use javascript all the time to change how I show or handle a field. I also have used one function to control the element no matter your viewing, adding a new record or editing and existing record.
I would just google "Changing classes dynamically" using javascript.

Hope this gives you some hope and direction.

Gareth,

unfortunately it's impossible.

Readonly value is just a plain text, you can't change readonly value in the JavaScript code.

G
garethp authorDevClub member 6/13/2008

Thaks very much for the great pointer - I will give this a go.
Thanks again for taking the time to respond