The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> filling default value in forms, Hown to place the value of a server variable as default value of a tex
pmgraaf
post Jan 18 2010, 09:07 AM
Post #1





Group: Members
Posts: 4
Joined: 18-January 10
Member No.: 10,854



hi, I am new to web designing and I am looking for a better solution to my problem then the one that have come up with so far.

This is what I want to build:
I need a page that displays the current values of variables on my server in a form input text fields. The user is then able to change one of all the values and post them back to the server. the page should then be updated with the new values of the server variables.


This is what I have build myself:

<html>
<head>
<title>Params</title>
</head>

<body>


<form name="Params" action="Params.shtml" method="GET" target="_self">

<input type="text" name="IP1" size="1" maxlength="3" value="%! IP1 ! />
<input type="text" name="IP2" size="1" maxlength="3" value="%! IP2 ! />
<input type="text" name="IP3" size="1" maxlength="3" value="%! IP3 ! />
<input type="text" name="IP4" size="1" maxlength="3" value=%! IP4 ! />

<p><input type="submit" value="Submit">

</form>
</body>
</html>

I have a lot more input text fields but the principle is the same. I use server side scripts to load initial values in to the text fields. But to do this I need a script for every field. My server is running on a embedded machine with a limited TCP connection. Because of all the scripts I have to use this way my page loads really slow.

Therefore my question is: Is there an other way to Get and set the initial value of my input test fields???

Any help would be greatly appreciated.

Peter




User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 18 2010, 05:04 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



I'm no programmer, but I don't understand how you do it now, why you need one script per input? What is the server side language you use?

To my non-programmer mind it seems better to let the script generate the whole form with the fields prefilled.

I move this to server side scripting.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pmgraaf
post Jan 19 2010, 02:57 AM
Post #3





Group: Members
Posts: 4
Joined: 18-January 10
Member No.: 10,854



Thanks for your replay pandy,

I am working with ANSI C on my server, but to put it correctly, it is a embedded web server on a device with no operating system rolleyes.gif

But yes, I could use one server side script and that would be a better solution than this. The downside is that a big part of my html will then be a script. I have more input fields than I showed in the example and they or located all over my page (in different tables).
Is far as I know, this would mean that I need to more a lot of html code in to my script to.

Still it is the best solution I have so far, but the reason I asked this question is that I don't know all possibilities of html. I was thinking more like using 1 http Get instruction to receive all de input field values in my form. But I don't know if this is possible.

Can I execute a form on showing the page?
And is it possible to Get a value in a input field with a http Get?


Please, try to understand that I am new to this and don't always know what is possible. Some of the thinks a ask are probably not even posible. But I would like to make sure. Also please don't refer me to the F.A.Q. about forms, because I have looked there and have found no answers to my questions.

Again any help would be greatly appreciated.

Peter
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Jan 19 2010, 04:34 AM
Post #4


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE
I am working with ANSI C on my server, but to put it correctly, it is a embedded web server on a device with no operating system


This is a mystery - what does it mean? I can't actually believe you have a web server that runs on a naked computer, like the airline booking system in the 1960s that ran on a bare IBM 360. Nowadays even electric nose clippers probably run Linux...

What is your server called? What is this device? Where is the ANSI C?

QUOTE
I was thinking more like using 1 http Get instruction to receive all de input field values in my form. But I don't know if this is possible.


No it isn't. But it doesn't really make sense either. Your server responds to http requests by sending a document, and if the value of a field in a form in the document needs to be "fish" then you need to have "fish" written in that field.

But then I don't quite understand what you mean by "server variables". How do these vary?

I think you need to explain quite what web server this is first.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pmgraaf
post Jan 19 2010, 06:34 AM
Post #5





Group: Members
Posts: 4
Joined: 18-January 10
Member No.: 10,854




thank you Brian Chandler,

I think I have all the answers I need from you replay.

But I would still like to answer your questions and I am open to any and all solutions to my problem.

To answer your question:
My webserver runs on a embedded device 160 MHz, 265KB Flash ROM, 16K RAM. Very limited and therefore very cheap smile.gif . I do have 4 MB external storage space to store data (or webpages). So yes, I am running my server on a microchip that doesn't have a operating system. But this should not be problem, my webserver works like any other, only slower.

But maybe you can still help me with my problem.
I want to display a page with on it the current configurations (variables) of my device. Then I want to give the user the ability to make changes and Post them back to my device.

for example, My device can blink a LED. the ON-time and OFF-time are variables. I would like to page to display the current On-time and OFF-time in input text fields and then be able to change them and Post the values back to so they can be used as new ON-time and OFF-time.


If anybody could tell me the best way to do this. Then that would really help me.

I really hope I have mean my problem clear with this, if not than please ask and I will try to answer.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Jan 19 2010, 09:35 AM
Post #6


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE
I want to display a page with on it the current configurations (variables) of my device. Then I want to give the user the ability to make changes and Post them back to my device.


Right. Well you need your mystery webserver to output a valid html page, including the values of system variables. The document sent to the (remote) browser will need to be a valid html document, and it might show the "On time" thus:

<p>On time: 1330</p>

But this value "1330" is system variable, so you have to read the documents for your web server to find out how to include it in the html document you send.

If you want the user to be able to change the value, you output a form, and they submit it. Then you need to read your server documents again to find out how to process a form.

Sorry, since you don't tell us anything concrete about the server, we can't help you use it. If copying a system variable into the output file is a slow operation, again, this isn't a problem of html.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pmgraaf
post Jan 19 2010, 10:03 AM
Post #7





Group: Members
Posts: 4
Joined: 18-January 10
Member No.: 10,854



Thanks for your help. I think I know all that I need to.

You see, I already know how to ouput data or forms and how to get the result.

I only needed to know if there ware other ways to do it. And from your reaction and the information I search for myself I most conclude that there is no other way.

Again thank for your swift replay.

kind regards,

Peter
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th April 2024 - 01:29 PM