I've been working on a form to allow providers to fill out their Endoscopy reports online. I'm trying to do something very simple. If a user selects a checkbox change the value within a Text Field. Either one allows the code to run once. It will change the value one time - even though I think it is putting the wrong value in the code - but that is neither here nor there at this point.
Here is the code I believe should work.
form1.EndoscopyPage1.TestChkBox::click - (JavaScript, client)
if (this.rawValue == 1)
{
TestTxt1.rawValue = "ON"; // user cannot enter field
}
else
{
TestTxt1.rawvalue = "off" ; // user can enter field
}
I've tried the following as well
//if (TestChkBox.value = 0) then
// TestTxt1.editValue = "Off";
//endif;
//if (TestChkBox.value = 1) then
// TestTxt1.editValue = "ON";
//endif;
I've attached the file as well. My test fields are in the middle of the first page.
Solved! Go to Solution.
Views
Replies
Total Likes
Its just a typo mistake. You typed rawvalue instead of rawValue 'V' must be upper-case.
See the snap attahed. It works for me after changing that property.
Nith
Views
Replies
Total Likes
The method you want is access and if you want to lock the field set it to readOnly and if you want to allow entry set it to "". So your code shoudl look like this:
Paul
Views
Replies
Total Likes
Paul,
Thanks for the advise. I guess the words "ON" and "OFF" may be confusing. I'm not trying to turn off access or turn on access to the text field.
I'm trying to put a string within the text box. For example, I'd Like to put "Endoscopy procedure lower was normal" within the text box if it is selected. If it is not selected I'd put "Endoscopy procedure was abnormal".
The file is attached in original email.
Views
Replies
Total Likes
Then the rawValue is what you want .....the code will look like this:
Paul
Views
Replies
Total Likes
That is really what I have. It doesn't work.
If you run the attached file, you will see.
If I place a check mark in the checkbox, It changes it once and only once. If I select it the first time, it will type in "OFF" <which it should be on because of the 1> but it is wrong. The next time I unselect it - it doesn't do anything. It should do something, but it doesn't.
Views
Replies
Total Likes
Okey... I am not quite sure if I can help much...
On which event did you put it? I'd put it on change...
Well, then check out if your "on" and "off" values really are really what you asked for. If they are and it still won't work, you could try to make 2 if sentences instead of an if...else.
Views
Replies
Total Likes
Its just a typo mistake. You typed rawvalue instead of rawValue 'V' must be upper-case.
See the snap attahed. It works for me after changing that property.
Nith
Views
Replies
Total Likes
The last thing helped. So frustrating working 2 - 3 hours on a problem and the only thing it was - A Capital Letter.
Thanks
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies