Project

General

Profile

Create form tag

Added by Dominik Baláž almost 6 years ago

Hi,

I want to ask, if it is possible to create form in this way

<form>
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit">
</form>

D.


Replies (3)

RE: Create form tag - Added by lm at almost 6 years ago

As ordinary and normal as this seems, I don't think this is one of the things Wt does. It's a single page application, so the POST response to the form and subsequent full refresh is something Wt would avoid. That said, I'm not sure I'm right.

If you're new to Wt, you'll want to know that what you put up there is not the "Wt way". You can get those values in a much smoother, single-page-application way using Wt Widgets in the normal way.

RE: Create form tag - Added by Roel Standaert almost 6 years ago

Creating forms like that is indeed not the way you would do it with Wt. Wt will only submit a form if you're using a browser without JavaScript support (or JavaScript support disabled). In that case it will actually put a <form> tag around the entire page, so then you also shouldn't provide the form tag yourself.

The way you would accomplish that is through two WLineEdits and a WPushButton.

You can check out the widget gallery's Forms section for some more info: https://www.webtoolkit.eu/widgets/forms

RE: Create form tag - Added by Dominik Baláž almost 6 years ago

Yes, I thought this, but I wanted to ask just to be sure.

Thanks for replies.

D.

    (1-3/3)