Author Topic: dynamic variable generation in web pages  (Read 8953 times)

Offline suhas

  • Newbie
  • *
  • Posts: 13
    • View Profile
dynamic variable generation in web pages
« on: October 20, 2009, 07:18:06 AM »
Hi All,
In below line what is meaning of £vIs,£dSD, £DM6 ,£vIm , £sM2 and why we used this ?

tr><td>Subnet mask<td colspan="4"><input maxLength=15 size=15 name=Is value="£vIs" £dSD £DM6>£vIm<th><input id=m3 type=checkbox name=r £sM2 disabled>
(This line belong to file  4lan.htm)

Regards,
Suhas

Online mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: dynamic variable generation in web pages
« Reply #1 on: October 20, 2009, 10:17:08 AM »
Hi Suhas

There is a general introduction to this here: http://www.utasker.com/forum/index.php?topic=82.0

In this specific case it works as follows:

<tr><td>Subnet mask<td colspan="4"><input maxLength=15 size=15 name=Is value="£vIs" £dSD £DM6>£vIm<th><input id=m3 type=checkbox name=r £sM2 disabled>
£vIs - £ = command v = insert string I = IP address s = sub-net mask - webInterface.c inserts the sub-net mask
£dSD - £ = command d = disable the field if the following is NOT true: S = server enabled? D = DHCP
£DM6 - £ = command D = disable the field if the following IS true: M = value modified? 6 = validated
£vIm - £ = command v = insert string I = IP address m = IP obtained by DHCP
£sM2 - £ = command v = insert string M = value modified 2 = sub-net mask

The codes used for parsing are defined in config.h so can be changed if desired (eg. often $ is used instead of £ since the £ is not available on US key boards). It is also possible to extend the command sequence to more characters (WEB_ESCAPE_LEN in config.h - default is 4).

It is the code in webInterface.c which controls exactly what the commands do. If you search for the individual command letters in fnIsSelected() and fnInsertString() it should become clear. Adding your own extensions is then also quite easy - best test in the simulator since it is much easier than doing such work on target HW.

Regards

Mark