Forum Moderators: phranque

Message Too Old, No Replies

How are checkboxes made?

         

webjourneyman

10:51 pm on Jul 25, 2006 (gmt 0)

10+ Year Member



As in where you can select colour, size, cost, range, weight etc. for a widget.

And then press search to get a list of appropriate widgets that fit the bill?

celgins

2:35 am on Jul 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you are talking about textboxes on a webpage, they are created with forms. The simplest would be:

<form method=post action=select.php>
<input type="checkbox" name="cost" value="$1.99">
<input type="submit" value="Submit">
</form>

The "select.php" file would contain the appropriate scripting code to begin the search for $1.99 items.

It gets more detailed than that on the coding side, but I'm not sure exactly what you are looking for.

webjourneyman

10:19 am on Jul 26, 2006 (gmt 0)

10+ Year Member



Yes thank you. This is what I mean, I was looking at the source code of a webpage that uses a checkbox and these are the same commands.

So this is done in PhP/Mysql?

rocknbil

6:02 pm on Jul 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP is one of the many sever-side programming languages that process the data submitted to it from the form. The server-side processor can be in any language supported by the server - perl, asp, cold fusion, there are many. I prefer perl because it has many uses BEYOND simple web submissions, and php is limited to web applications (mostly.) :-)

Mysql is the open source database programming for the web, built on the concepts of SQL (Structured Query Language.) It is build around common sense queries to a database to insert, modify, read, or delete database entries. For example, a typical shopping cart query might be: insert into purchases (color,size,price) values ('red','large','1.99');

So you use the form to collect and submit data, a server-side processor to read in the data and perform whatever functions you need to perform, such as insert the data into a database and send you an email notifying you of the action.

Lots more to it, but that's the basic concept . . . :-)

webjourneyman

12:47 pm on Jul 27, 2006 (gmt 0)

10+ Year Member



Thanks Rocknbill, that explains it quite nicely.

What is the simplest method of processing the data submitted to the form and populate a list to be displayed onscreen?

I was thinking IŽd use radio buttons where users could select preference in regards to a few aspects.

Based on their choices there would be displayed a list of best matches. If there is no match then closest matches.

On htmlgoodies they show listmaking using forms and cgi, how does cgi compare to perl, php for this particular purpose?

celgins

2:35 pm on Jul 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What is the simplest method of processing the data submitted to the form and populate a list to be displayed onscreen?

This really depends on your comfort level with one of those server-side programming languages rocknbil mentioned. Each one has different coding techniques for accepting your form data, whether it's radio buttons, checkboxes, or text boxes.