开发者

Is there more to HTML forms than http://www.w3schools.com/html/html_forms.asp?

开发者 https://www.devze.com 2022-12-23 02:15 出处:网络
I am creating a form designer. It will generate PHP code which will produce an HTML form. Users will fill in fields and the PHP will store user input in a MySql database (and, of course, they can use

I am creating a form designer. It will generate PHP code which will produce an HTML form. Users will fill in fields and the PHP will store user input in a MySql database (and, of course, they can use the designer to generate forms which query the database).

I am using Borland C++ Builder (very similar to Delphi & and you can get the same idea from VB, MSVC, Qt ... any IDE with a RAD GUI designer).

Looking at the W3C page http://www.w3schools.com/html/html_forms.asp it seems that the components I can use for my form and retrieve data from are

  - edit box    / TEdit       / <input type="text"   
  - memo        / TMemo       / <input type="textarea"    
  - check box   / TCheckBox   / <input type="CheckBox"
  - Combo box   / TComboBox   / <select ... <option...
  - Radio group / TRadioGroup / <input type="radio"
  - Group box   / TGroupBox   / <fieldset ... <legend ...
  - Panel       / TPanel      / <fieldset ...

I am unsure whether to allow button / TButton/ input type="button" - other than a single submit button which my form designer program automatically adds to the end of the generated form.

But my real question is - did I miss any? It might be nice to have masked edit which only accepts numbers, or maybe some form of "spin control" 开发者_如何转开发(TUpDown, or slider + linked read only TEdit), so that the user can click & hold to increment/decrement an integer value.

And a calendar component would be nice.

Very important: I want to implement it all server-side in PHP, so no client-side JS or Ajax or the likes.

If there anything else that I can add to make my generated forms look more impressive in the browser?


Unfortunately things like spin controls and or masked edit controls require client side script (is their a reason you'd rather avoid this? Jquery and others offer the ability to do unobtrusive javascript where your spin and masked edit controls would just revert to ordinary textboxes for older browsers and for those with js turned off).

If you are going to be supporting only the very latest cutting edge browsers then you can take a look at HTML5 which gives some new possibilities but basically isn't supported quite yet.

One thing worth mentioning is that the <select /> element can act like a TListBox too depending on which parameters you set, including supporting multiple item selection.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号