This topic is locked
[SOLVED]

 Readonly Field in Add Page

6/7/2010 3:09:55 PM
ASPRunnerPro General questions
J
Jay123 author

Hi!
I am using ASPRunner 6.1.
I have a field called SeatsTotal. This field is dependent on a dropdown field called Group. I set this field (SeatsTotal) as a lookup wizard which gets its value from a query. Everything works fine.
What I want to do is make this field (SeatsTotal) as readonly in the Add page. Since I set it up as a lookup wizard in the "editas" setting window, I can no longer select readonly.
Is there a way to make it as a lookup wizard and readonly at the same time by adding a script in the HTML editor? I know the script to make it as disabled. If it can't be set as readonly, how can I change the disabled text colour from gray to black or red?
Thanks,

Jay

A
ann 6/8/2010

Jay,
you can't set lookup as readonly in JavaScript, only disabled. Use style.color to change the color of the text. Here is a sample:

<script>

document.forms.editform.value_SeatsTotal.onchange=document.forms.editform.value_SeatsTotal.onkeyup=function()

{

if(document.forms.editform.value_SeatsTotal.value.length==0)

document.forms.editform.value_SeatsTotal.style.color='Black';

else

document.forms.editform.value_SeatsTotal.style.color='Red';

}

</script>
J
Jay123 author 6/8/2010

Hi Ann,
Thanks for the reply.
It didn't do the trick that I was hoping for. What I would like to happen is, I want the SeatsTotal value to change its colour when an item is selected from the GroupNo dropdown. Also, I would like to have the textbox line around the value to be removed.
Example: If a group (Car) is selected from the GroupNo dropdown, I want the value of the SeatsTotal (10) to become colour red. The value of SeatsTotal will always be red regardless of the choices in the GroupNo dropdown.
Since lookup cannot be set as readonly, I guess my only solution is to make the SeatsTotal disabled. The question is, if the SeatsTotal (10 in the example above) is disabled, can I make its colour red? Right now, the colour of the disabled value is gray. Another question, is it possible to remove the textbox line around the SeatsTotal value?
Thanks,

Jay

Sergey Kornilov admin 6/8/2010

Jay,
removing the border around dropdown box and changing text color is not possible.

J
Jay123 author 6/9/2010

Thanks for the information, Sergey.
Do you know in what file can I change the border color of the table and cells in Add Page? Likewise, in which line should I change them?
Thanks,

Jay

J
Jay123 author 6/10/2010

Never mind. I figured it out.