Languages Java Debugging and Error Handling  

FlyFormX

download download  
important code information
author:
Dinesh Copoosamy
minimum requirements:
FlyFormX description

Generates html forms dynamically from xml description files



Author: Dinesh Copoosamy
web : www.devkungfoo.com
Copyright (C) (see GPL.html)

FlyFormX is a dynamic form generator that I wrote to work specifically on
the pocket pc 2000. It works in pocket IE and on the desktop, this is just
a preliminary version.
Keep a lookout for the next version, which will be a meaty version.


UI Description file
-------------------

<?xml version="1.0"?>
<form name="register" action="" method="">
<item>
<input caption="name" name="textbox1" type="textbox" value="santa" size="15" maxlength="15" />
<input type="linebreak"/>
<input caption="email" name="textbox2" type="textbox" value="santa@np.com" size="15" maxlength=""/>
<input type="linebreak"/>
<input caption="language" name="select1" type="select" size="1">
<option name="English" value="en" />
<option name="French" value="fr" />
</input>
<input type="linebreak"/>
<input name="radiogroup1" type="radio">
<option caption="Male" value="M" checked="true" />
<option caption="Female" value="F" />
</input>
<input type="linebreak"/>
<input caption="news" name="checkbox1" type="checkbox" checked="true"/>
<input caption="jokes" name="checkbox2" type="checkbox" />
<input type="linebreak"/>
<input caption="comment" name="textarea1" type="textarea"/>
<input type="linebreak"/>
<input name="btnGo" type="button" value="Go" onclick="go();"/>
<input name="Reset" type="button" value="Clear" subtype="reset"/>
<input type="linebreak"/>
</item>
</form>


firstly, its xml so the xml declaration in line 1 belongs there
next the root element is <form name="XXX" action="XXXX" method="XXX">
those attributes are placeholders for the next verison, they are ignored at present.

each input element is placed in an input tag all.
Common attributes are (except for linebreak which only has the type attribute):
- name : whatever you want to name your element
- type : textbox, select, radio, checkbox, button, linebreak

Lets look at each element type and their specs

textbox :
---------
<input caption="name" name="textbox1" type="textbox" value="santa" size="15" maxlength="15" />

- caption is used to provide the label that sits alongside the textbox
- name .....
- type will be textbox
- value - used to specify a default value
- size - the display size of the textbox (important to have for pda's)
- maxlength - maximum allowable length of input



Select :
------
<input caption="language" name="select1" type="select" size="1">
<option name="English" value="en" />
<option name="French" value="fr" />
</input>

- Caption like above
- type is select
- size - this handles the amount of items in the box that are visible (1 - drop down box, > 1 list box)

Then we have each option as a child element of the select element
with attributes:
- name: which is the displayed name of the option
- value: which is the actual value passed
NOTE don't forget to close the input element after the options


Radio:
------

<input name="radiogroup1" type="radio">
<option caption="Male" value="M" checked="true" />
<option caption="Female" value="F" />
</input>

work the same way as a select the differences are:

- the input element only has a name, type attribute
- the option element can have the attribute checked (used to specify the default choice)

NOTE each option then becomes a radio button in that group.


checkbox:
---------

<input caption="news" name="checkbox1" type="checkbox" checked="true"/>

same as the textbox but has the attribute checked (which can be true or false)


button:
------

<input name="btnGo" type="button" value="Go" onclick="go();"/>

- this is a standard button
- name : the buttons name
- type button
- value : the name displayed on the button
- onClick: will be used when i allow users to pass user defined event handlers
for now just specify go(); and then handle the form in the function go()
that is in the flyformx.html file.




<input name="Reset" type="button" value="Clear" subtype="reset"/>

form buttons (submit, reset)
- same as above but has attribute subtype which can be either submit or reset
- these will then have standard submit and reset functionality.

linebreak:
----------

<input type="linebreak"/>
- used to break a line (it places a <br/> at the specified part of the form)

NOTE more robust formatting tags will be included in the next version



Usage:
-----
just place your xml file in the same directory as the flyformx.html file
and then load the flyformx.html and specify the name of the xml file.
(A demo xml ui file is supplied - myform.xml)


Enjoy :)




File List:
@PSC_ReadMe_4277_2.txt482b
flyformx.html6Kb
myform.xml1Kb
readme.txt5Kb

Similar code
List ALL properties for ANY object (Popularity: ) : A new window is opened, with a table listing all available properties with values for your object.
J2ME Prevent Screen Lock-ups (Popularity: ) : Preventing Screen Lockups of Blocking Operations by Qusay H. Mahmoud When you're developing networking MIDlets, pay special attention to blocking ...
Development Tools v1.10 (Popularity: ) : Updated Dec 12, 2002: This is a great tool for the advanced web developer, especially when complicated javascript is involved. ...
Simple Compiler (Popularity: ) : This is just Simple Compiler demo program which i h required to build for my Programming Language subject. Its use ...
User reviews

Write a review:
1 2 3 4 5 6 7 8 9 10
1=poor 10=excellent
Write review*
Your name*
Email*
  (Comments are moderated, and will not appear on this site until the editor has approved them)
 
Rate me
supported os
stats
downloads 26
version
size in Kb 5
popularity   613/5995046
user rating 8/10
ad


New Code
Popular Code