-
How to captue information in an option button control to pass to asp?
I am new to asp development, as you are about to see, and have what will probably
seem a simple question. I am using Visual Interdev to develope some simple
web pages. I have two design time controls shown below, that I am using to
try and capture information from a user for selection of flavors. The controls
are option group controls. My first question is,
1: Is there an easier way to create option group controls without using the
design time controls. If so, how, and how do I pass this information using
a form to capture the information to send to another asp?
2: If number 1 cannot be done, then how can I capture the information using
a form to send to another asp. And can I strip out any of the extensive parameters?
Below the 1st control is for Chocolate and the second control is for Vanilla.
I have searched this site for information on this and have not found any.
Any help, as always, will be very much appreciated. Thanks for your patients.
<OBJECT classid=clsid:8BD21D50-EC42-11CE-9E0D-00AA006002F3 height=20
id=DispIHTMLObjectElement1
style="BACKGROUND-COLOR: #999999; COLOR: #999999; FONT-FAMILY: serif;
FONT-SIZE: xx-small"
VariousPropertyBits? VALUE="746588187" VIEWASTEXT><PARAM NAME="VariousPropertyBits"
VALUE="746588187"><PARAM NAME="BackColor" VALUE="16777215"><PARAM NAME="ForeColor"
VALUE="0"><PARAM NAME="MaxLength" VALUE="0"><PARAM NAME="BorderStyle" VALUE="0"><PARAM
NAME="ScrollBars" VALUE="0"><PARAM NAME="DisplayStyle" VALUE="5"><PARAM NAME="MousePointer"
VALUE="0"><PARAM NAME="Size" VALUE="3440;529"><PARAM NAME="PasswordChar"
VALUE="0"><PARAM NAME="ListWidth" VALUE="0"><PARAM NAME="BoundColumn" VALUE="1"><PARAM
NAME="TextColumn" VALUE="65535"><PARAM NAME="ColumnCount" VALUE="1"><PARAM
NAME="ListRows" VALUE="8"><PARAM NAME="cColumnInfo" VALUE="0"><PARAM NAME="MatchEntry"
VALUE="2"><PARAM NAME="ListStyle" VALUE="0"><PARAM NAME="ShowDropButtonWhen"
VALUE="0"><PARAM NAME="ShowListWhen" VALUE="1"><PARAM NAME="DropButtonStyle"
VALUE="1"><PARAM NAME="MultiSelect" VALUE="0"><PARAM NAME="Value" VALUE="0"><PARAM
NAME="Caption" VALUE="Chocolate"><PARAM NAME="PicturePosition" VALUE="458753"><PARAM
NAME="BorderColor" VALUE="2147483654"><PARAM NAME="SpecialEffect" VALUE="2"><PARAM
NAME="Accelerator" VALUE="0"><PARAM NAME="GroupName" VALUE="AGE OF HOME"><PARAM
NAME="FontName" VALUE="Times New Roman"><PARAM NAME="FontEffects" VALUE="1073741825"><PARAM
NAME="FontHeight" VALUE="200"><PARAM NAME="FontOffset" VALUE="0"><PARAM NAME="FontCharSet"
VALUE="1"><PARAM NAME="FontPitchAndFamily" VALUE="2"><PARAM NAME="ParagraphAlign"
VALUE="1"><PARAM NAME="FontWeight" VALUE="700"></OBJECT><br>
<OBJECT classid=clsid:8BD21D50-EC42-11CE-9E0D-00AA006002F3 height=20
id=DispIHTMLObjectElement1
style="BACKGROUND-COLOR: #999999; COLOR: #999999; FONT-FAMILY: serif;
FONT-SIZE: xx-small"
VIEWASTEXT VALUE="746588187" VariousPropertyBits?><PARAM NAME="VariousPropertyBits"
VALUE="746588187"><PARAM NAME="BackColor" VALUE="16777215"><PARAM NAME="ForeColor"
VALUE="0"><PARAM NAME="MaxLength" VALUE="0"><PARAM NAME="BorderStyle" VALUE="0"><PARAM
NAME="ScrollBars" VALUE="0"><PARAM NAME="DisplayStyle" VALUE="5"><PARAM NAME="MousePointer"
VALUE="0"><PARAM NAME="Size" VALUE="3440;529"><PARAM NAME="PasswordChar"
VALUE="0"><PARAM NAME="ListWidth" VALUE="0"><PARAM NAME="BoundColumn" VALUE="1"><PARAM
NAME="TextColumn" VALUE="65535"><PARAM NAME="ColumnCount" VALUE="1"><PARAM
NAME="ListRows" VALUE="8"><PARAM NAME="cColumnInfo" VALUE="0"><PARAM NAME="MatchEntry"
VALUE="2"><PARAM NAME="ListStyle" VALUE="0"><PARAM NAME="ShowDropButtonWhen"
VALUE="0"><PARAM NAME="ShowListWhen" VALUE="1"><PARAM NAME="DropButtonStyle"
VALUE="1"><PARAM NAME="MultiSelect" VALUE="0"><PARAM NAME="Value" VALUE="0"><PARAM
NAME="Caption" VALUE="Vanilla"><PARAM NAME="PicturePosition" VALUE="458753"><PARAM
NAME="BorderColor" VALUE="2147483654"><PARAM NAME="SpecialEffect" VALUE="2"><PARAM
NAME="Accelerator" VALUE="0"><PARAM NAME="GroupName" VALUE="AGE OF HOME"><PARAM
NAME="FontName" VALUE="Times New Roman"><PARAM NAME="FontEffects" VALUE="1073741825"><PARAM
NAME="FontHeight" VALUE="200"><PARAM NAME="FontOffset" VALUE="0"><PARAM NAME="FontCharSet"
VALUE="1"><PARAM NAME="FontPitchAndFamily" VALUE="2"><PARAM NAME="ParagraphAlign"
VALUE="1"><PARAM NAME="FontWeight" VALUE="700"></OBJECT><br>
-
Re: How to captue information in an option button control to pass to asp?
There is a much easier way to do this using the Html Radio Button control
and a form
this is the body of first ASP page with controls:
MyPage.asp
<script language="JavaScript">
function myValidator(theForm) {
if theform.somecontrol.value == "" {
alert("Please enter a value form 'somecontrol'");
theForm.Somecontrol.setfocus;
return (False);
}
return (True);
}
</script>
<FORM Action="Myaspscript.asp" method="post" onsubmit="return
myValidator(this);" name="Form1">
<P> These are my optons</p>
<P><INPUT Type="radio" id="optionsgroup1" name="optionsgroup1" value="1"
SELECTED> Option 1</P>
<P><<INPUT Type="radio" id="optionsgroup1" name="optionsgroup1"
value="2"> Option 2</P>
<P><<INPUT Type="radio" id="optionsgroup1" name="optionsgroup1"
value="3"> Option 3</P>
<P><<INPUT Type="radio" id="optionsgroup1" name="optionsgroup1"
value="4"> Option 4</P>
<P> </p>
<INPUT type="submit" value="submit" name="submit">
</Form>
This displays 4 option buttons (options 1 through 4) and options 1 is set by
default (the SELECTED tag). Notice how all the radio buttons have the same
the same name but different values. That makes them a group.
In the Form declaration: "action" is the asp page that will be called when
the submit button is clicked, the "onsubmit" value allows you to specify a
JavaScript function to be called to validate your form.
Myaspscript.asp
<%
select case request.form("optionsgroup1")
case "1"
MyObject.InvoqueMethod (val1, val2)
respoanse.redirect "thispage.asp?val1=1&val2=2"
case "2"
'do something
...
end select
%>
All the values for the controls in the form from Mypage.asp are passed to
Myaspscript.asp and can be accessed via the Request object's Form
collection. Since the radio button form a group, only the selected value is
loaded into the collection, so you don't have to text every button to which
one is active.
Value from a textbox or a dropdown list could be accessed the same way.
Marc D'Aoust
marc_daoust@hotmail.com
"JACK" <RDDELERY@DIALNET.NET> wrote in message
news:392555a8$1@news.devx.com...
>
> I am new to asp development, as you are about to see, and have what will
probably
> seem a simple question. I am using Visual Interdev to develope some simple
> web pages. I have two design time controls shown below, that I am using to
> try and capture information from a user for selection of flavors. The
controls
> are option group controls. My first question is,
> 1: Is there an easier way to create option group controls without using
the
> design time controls. If so, how, and how do I pass this information using
> a form to capture the information to send to another asp?
> 2: If number 1 cannot be done, then how can I capture the information
using
> a form to send to another asp. And can I strip out any of the extensive
parameters?
>
> Below the 1st control is for Chocolate and the second control is for
Vanilla.
> I have searched this site for information on this and have not found any.
> Any help, as always, will be very much appreciated. Thanks for your
patients.
>
> <OBJECT classid=clsid:8BD21D50-EC42-11CE-9E0D-00AA006002F3 height=20
> id=DispIHTMLObjectElement1
> style="BACKGROUND-COLOR: #999999; COLOR: #999999; FONT-FAMILY:
serif;
> FONT-SIZE: xx-small"
> VariousPropertyBits? VALUE="746588187" VIEWASTEXT><PARAM
NAME="VariousPropertyBits"
> VALUE="746588187"><PARAM NAME="BackColor" VALUE="16777215"><PARAM
NAME="ForeColor"
> VALUE="0"><PARAM NAME="MaxLength" VALUE="0"><PARAM NAME="BorderStyle"
VALUE="0"><PARAM
> NAME="ScrollBars" VALUE="0"><PARAM NAME="DisplayStyle" VALUE="5"><PARAM
NAME="MousePointer"
> VALUE="0"><PARAM NAME="Size" VALUE="3440;529"><PARAM NAME="PasswordChar"
> VALUE="0"><PARAM NAME="ListWidth" VALUE="0"><PARAM NAME="BoundColumn"
VALUE="1"><PARAM
> NAME="TextColumn" VALUE="65535"><PARAM NAME="ColumnCount" VALUE="1"><PARAM
> NAME="ListRows" VALUE="8"><PARAM NAME="cColumnInfo" VALUE="0"><PARAM
NAME="MatchEntry"
> VALUE="2"><PARAM NAME="ListStyle" VALUE="0"><PARAM
NAME="ShowDropButtonWhen"
> VALUE="0"><PARAM NAME="ShowListWhen" VALUE="1"><PARAM
NAME="DropButtonStyle"
> VALUE="1"><PARAM NAME="MultiSelect" VALUE="0"><PARAM NAME="Value"
VALUE="0"><PARAM
> NAME="Caption" VALUE="Chocolate"><PARAM NAME="PicturePosition"
VALUE="458753"><PARAM
> NAME="BorderColor" VALUE="2147483654"><PARAM NAME="SpecialEffect"
VALUE="2"><PARAM
> NAME="Accelerator" VALUE="0"><PARAM NAME="GroupName" VALUE="AGE OF
HOME"><PARAM
> NAME="FontName" VALUE="Times New Roman"><PARAM NAME="FontEffects"
VALUE="1073741825"><PARAM
> NAME="FontHeight" VALUE="200"><PARAM NAME="FontOffset" VALUE="0"><PARAM
NAME="FontCharSet"
> VALUE="1"><PARAM NAME="FontPitchAndFamily" VALUE="2"><PARAM
NAME="ParagraphAlign"
> VALUE="1"><PARAM NAME="FontWeight" VALUE="700"></OBJECT><br>
>
> <OBJECT classid=clsid:8BD21D50-EC42-11CE-9E0D-00AA006002F3 height=20
> id=DispIHTMLObjectElement1
> style="BACKGROUND-COLOR: #999999; COLOR: #999999; FONT-FAMILY:
serif;
> FONT-SIZE: xx-small"
> VIEWASTEXT VALUE="746588187" VariousPropertyBits?><PARAM
NAME="VariousPropertyBits"
> VALUE="746588187"><PARAM NAME="BackColor" VALUE="16777215"><PARAM
NAME="ForeColor"
> VALUE="0"><PARAM NAME="MaxLength" VALUE="0"><PARAM NAME="BorderStyle"
VALUE="0"><PARAM
> NAME="ScrollBars" VALUE="0"><PARAM NAME="DisplayStyle" VALUE="5"><PARAM
NAME="MousePointer"
> VALUE="0"><PARAM NAME="Size" VALUE="3440;529"><PARAM NAME="PasswordChar"
> VALUE="0"><PARAM NAME="ListWidth" VALUE="0"><PARAM NAME="BoundColumn"
VALUE="1"><PARAM
> NAME="TextColumn" VALUE="65535"><PARAM NAME="ColumnCount" VALUE="1"><PARAM
> NAME="ListRows" VALUE="8"><PARAM NAME="cColumnInfo" VALUE="0"><PARAM
NAME="MatchEntry"
> VALUE="2"><PARAM NAME="ListStyle" VALUE="0"><PARAM
NAME="ShowDropButtonWhen"
> VALUE="0"><PARAM NAME="ShowListWhen" VALUE="1"><PARAM
NAME="DropButtonStyle"
> VALUE="1"><PARAM NAME="MultiSelect" VALUE="0"><PARAM NAME="Value"
VALUE="0"><PARAM
> NAME="Caption" VALUE="Vanilla"><PARAM NAME="PicturePosition"
VALUE="458753"><PARAM
> NAME="BorderColor" VALUE="2147483654"><PARAM NAME="SpecialEffect"
VALUE="2"><PARAM
> NAME="Accelerator" VALUE="0"><PARAM NAME="GroupName" VALUE="AGE OF
HOME"><PARAM
> NAME="FontName" VALUE="Times New Roman"><PARAM NAME="FontEffects"
VALUE="1073741825"><PARAM
> NAME="FontHeight" VALUE="200"><PARAM NAME="FontOffset" VALUE="0"><PARAM
NAME="FontCharSet"
> VALUE="1"><PARAM NAME="FontPitchAndFamily" VALUE="2"><PARAM
NAME="ParagraphAlign"
> VALUE="1"><PARAM NAME="FontWeight" VALUE="700"></OBJECT><br>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|