Forums

PHP

This topic is locked

radio button validation

Posted 10 Jun 2002 15:37:24
1
has voted
10 Jun 2002 15:37:24 Ken Carter posted:
I'm not finding a good way to do what I want. Pasted in below is a code snip from a page that I have on a detail page for a repeat region listing. I want to require the user to select a button before submitting the form.

Any suggestions gang???

Thanks,
Ken...

<?php
# echo;
$color=$stones->Fields("color";
$avilcolors=explode("/",$color);
$colorsavail=count($availcolors);
if(in_array("20",$avilcolors)) echo '<input type="radio" name="colorselect" value="20"> <img src="images/stones/graygranite.jpg" width="22" height="22">', " Gray Granite<br>";
if(in_array("30",$avilcolors)) echo '<input type="radio" name="colorselect" value="30"> <img src="images/stones/brownstone.jpg" width="22" height="22">', " Brownstone<br>";
if(in_array("40",$avilcolors)) echo '<input type="radio" name="colorselect" value="40"> <img src="images/stones/missionwhite.jpg" width="22" height="22">', " Mission White<br>";
?>

Replies

Replied 12 Jun 2002 01:44:18
12 Jun 2002 01:44:18 Tim Green replied:
The easiest way Ken, is to visit www.yaromat.com and download the Check Form behavior. Using this, you can apply it to any form on your page, and specifically determine whether an element must be set, or not, before the form is submitted.

I suspect this is what you're after.

I hope this helps.

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 12 Jun 2002 02:05:04
12 Jun 2002 02:05:04 Ken Carter replied:
The problem with that form check is that it only works on static not dynamic page elements. (or am I missing something?) I have Yaro's extension but it only sees items that are in the form as it exists during edit.

I suppose I could create the elements in static and then remove them after applying the behavior. Think that would work?

Ken...

Replied 12 Jun 2002 08:54:26
12 Jun 2002 08:54:26 Tim Green replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>The problem with that form check is that it only works on static not dynamic page elements.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Not true. A form is a form, regardless of whether it's values are populated from a db or not (remember the browser only receives the static info, it knows no difference). If it doesn't work, then something else is at play.

If when using it you encounter a particular problem, then we can deal with that, just let us know what problems you experience.

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>

Reply to this topic