Atozed Forums
How to read formControlRange Value after pressing a button - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: How to read formControlRange Value after pressing a button (/thread-1648.html)

Pages: 1 2


RE: How to read formControlRange Value after pressing a button - jeroen.rottink - 05-03-2020

Hi Alexandre,

Don't know if I see the complete picture.

I created an example 

  • Added a HiddenField named 'formControlRange'
  • A IWText holding the lines
    Code:
    <label for="formControlRange">Example Range input</label>
    <input type="range" min="1" max="100" class="form-control-range" id="formControlRange" name="formControlRange">
  • Two buttons. One with OnClick handler and one with OnAsyncClick handler. Both with following code
    Code:
    IWEdit1.Text := HiddenFields.Values['formControlRange'];


For the OnClick handler the hiddenfield is updated and sent to the server.
For OnAsyncClick this is not the case. No updated value is send to the server.

I thought a js call to AddChangedControl("formControlRange"); would be needed.


RE: How to read formControlRange Value after pressing a button - Alexandre Machado - 05-08-2020

Hi Jeroen,

You are correct regarding Async events. You need to explicitly tell IW that you want to submit that control content to the server, calling AddChangedControl()

It is not necessary in sync events, though, which was the specific case of this question.