Ask a Question related to Dreamweaver AppDev, Design and Development.
-
ossie #1
am i missing something simple asp:checkbox
Hi
I have a table in my db which basically stores users preferences as either a
1 or 0 (sql server tinyInt)
I built the insert page using MM Insert and standard checkbox with the
checked value set to 1, I had to manually change the default value set in
the insert paramaters to 0 to ensure I got either a 0 entered into db if
unchecked.
The problem I have now is on the update preferences page, the existing prefs
are loaded via a dataset and the update form wizard creates 50 checkboxes.
The problem I seem to have is that the asp:checkbox doesn't appear to have a
checked value so when I submit the form I get error converting to int.
I built a limited form with only 2 checkboxes and using the on pre-inserted
event, used:
dim myVar, myVar1
sub update1_onPreInsert()
if chbTest.Checked = True then
myVar = 1
Else
myVar= 0
End If
if chbTest.Checked = True then
myVar1 = 1
Else
myVar1= 0
End If
and used the variables as parameters for the update all is well. I have
around 50 checkboxes on the page so the code will be a bit of a nightmare if
the above is the only way to do it.
As I am using the <%# IIf((dsGetConfig.FieldValue("cantravel", Container) =
"1"), "checked", "") %> I can't use the standard checkbox.
In short is there an easy way to ensure the checked value of an asp:checkbox
is 1
ossie Guest
-
Links missing/update dialog missing upon file open
I am experiencing a strange problem when opening files with InDesign CS2. The usaul dialog box alerting you to missing/updated links does not appear.... -
Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked.
I am trying to update the database field when the checkbox is clicked. I am trying to modified the following solution but.. got stuck on the... -
missing guides. missing cursors. missing a good drawing app. Ugh.
I can't see my text cursor. It's invisible. Why? I can't see new guides I drag onto the documents. They are there, I just can't see them. Why? ... -
Simple checkbox population from Access
I am trying to populate a list of between 5-10 items which will be drawn from an Access Table to a form wherein the visitor can check boxes of each... -
Simple Checkbox Question
Hello, I have a checkbox on a form (i know very little about checkboxes) and I wanted it to be unchecked, so i set triple state to yes. Although... -
ossie #2
Re: am i missing something simple asp:checkbox
OK
I tried adding
checkbox1.attributes.add("Value", 1) to the page load event but still get
the following error
System.FormatException: Input string was not in a correct format.
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo
info)
at System.Int16.Parse(String s, NumberStyles style, IFormatProvider
provider)
at System.Int16.Parse(String s)
at DreamweaverCtrls.DataSet.ConvertParameterValue(Str ing strValue, Enum
theType)
at DreamweaverCtrls.DataSet.AddParameters(IDbCommand myCommand)
at DreamweaverCtrls.DataSet.DoInit()
Not the most helpfull of error messages and the stack trace does not reveal
any errors at all
when I look at the page source I notice that the value is not being assigned
to the checkbox
Any help gratefully received
"ossie" <fdsg@sdgf.com> wrote in message
news:d0ejoe$9pd$1@forums.macromedia.com...> Hi
>
> I have a table in my db which basically stores users preferences as either
> a 1 or 0 (sql server tinyInt)
> I built the insert page using MM Insert and standard checkbox with the
> checked value set to 1, I had to manually change the default value set in
> the insert paramaters to 0 to ensure I got either a 0 entered into db if
> unchecked.
>
> The problem I have now is on the update preferences page, the existing
> prefs are loaded via a dataset and the update form wizard creates 50
> checkboxes.
>
> The problem I seem to have is that the asp:checkbox doesn't appear to have
> a checked value so when I submit the form I get error converting to int.
>
> I built a limited form with only 2 checkboxes and using the on
> pre-inserted event, used:
> dim myVar, myVar1
> sub update1_onPreInsert()
> if chbTest.Checked = True then
> myVar = 1
> Else
> myVar= 0
> End If
> if chbTest.Checked = True then
> myVar1 = 1
> Else
> myVar1= 0
> End If
> and used the variables as parameters for the update all is well. I have
> around 50 checkboxes on the page so the code will be a bit of a nightmare
> if the above is the only way to do it.
> As I am using the <%# IIf((dsGetConfig.FieldValue("cantravel", Container)
> = "1"), "checked", "") %> I can't use the standard checkbox.
>
> In short is there an easy way to ensure the checked value of an
> asp:checkbox is 1
>
ossie Guest



Reply With Quote

