AWS- Can I change a button's value text?

Can I change a button’s value text to create an auto update ON/OFF toggle button? I also need this toggle button to make a call to RpSetRefreshTime() so that I can toggle web page updating either on or off.

I have not found a way to alter the buttons value text field from AWS. However, I can do it by using a javascript function and type=“button”. Problem is, AWS needs a type=“SUBMIT” button in order to get a callback. When I use type=“submit”, my javascript onclick gets called twice for some reason which nullifies the toggle effect. It may not be possible to use javascript and a submit button callback at the same time?

I just added HTML as follows (not within an AWS tag or anything):

You then get the text from the ‘value’ definition in the stub c file:
char ValsCopy12[] = “1 >> 2”;

So by allocating a fixed amount of space, you can copy various messages into that area.

You can do a ‘post’ to submit the form from the Javascript if necessary

I finally figured out a way to do a toggle submit button that can toggle a C/C++ variable and change the buttons text. I could do this previously with just javascript, but it has no support for interfacing with the C interface code. One solution I’ve found is to use RpDynamicDisplay and just have dual buttons (one of which won’t be shown when in the opposite mode)

Then in your submit handler, just check for which button called submit:

char *whichSubmitButton;

// get the value on the submit button presses (all submit button presses come to this function)
whichSubmitButton = RpGetSubmitButtonValue(theTaskDataPtr);

if(strstr(whichSubmitButton,“Enable”) != NULL) …

You can use RpFormNamedSubmit to dynamically change a button’s text.

You can use the callback function to call RpSetRefreshTime

citivic: I like the RpFormNamedSubmit method better, thanks for the comment. I’ll have to change the code when I get back into this project.