Project

General

Profile

WTemplate get event when input type color changed

Added by jean sorrant almost 4 years ago

Hi,

I'am trying Wt for a few days for now and I have trouble with a simple operation :

How is it possible to have an event in a WTemplate subclass if a user change the color. Or at least get the selected color when you click on a "apply" button?

template exemple:

<form>
      <div class="form-group">
        <label for="myColorPicker">Color</label>
        <input type="color" id="myColorPicker">
     </div>
</form>

thanks a lot


Replies (1)

RE: WTemplate get event when input type color changed - Added by Roel Standaert almost 4 years ago

First of all, you're not supposed to use <form> with Wt. Wt uses either JavaScript, or automatically inserts the <form> when using plain HTML.

Doing something like this would involve creating a custom widget or writing some JavaScript, and messing with signals.

Luckily for you, I actually just merged a pull request into master that implements a color input, so you can actually just use WColorPicker in Wt 4.4.0.

    (1-1/1)