TheLastBurden
04-04-2006, 03:16 AM
am trying to pass the checked values onto rqstDisplay.aspx
Does not work with the following VBScript code .
<script Language="VB" runat="server">
Sub SendToHelpDesk(sender As Object, e As EventArgs)
Dim V_DGI AS DataGridItem
Dim chkSelect As System.Web.UI.WebControls.CheckBox
For Each V_DGI in gridx.Items
chkSelect=CType(V_DGI.FindControl("CHK"),CheckBox)
If chkSelect.Checked then
h_req_id.value=CType(V_DGI.FindControl("req_id"),Label).Text
End If
Next
Server.Transfer("rqstDisplay.aspx")
End Sub
</script>
There's no error, but the value stored in h_req_id.value is blank.
Tried solving the same problem with javascript validation
<script Language=JScript >
function validate()
{
if(document.getElementById("<%=CHK.ClientID%>").checked==true)
{alert("JSCript");}
}
</script>
The above code gives the following error : BC30451: Name 'CHK' is not declared.
My HTML Form
<asp:TemplateColumn HeaderStyle-HorizontalAlign=Center HeaderText="X">
<ItemTemplate>
<asp:Checkbox ID="CHK" Runat="server" />
<asp:Label ID="req_id" Visible="False" Text='<%# DataBinder.Eval(Container.DataItem,"request_id") %>' Runat=server />
</ItemTemplate>
</asp:TemplateColumn> <input type=hidden name=h_req_id>
anyone haveany idea wh'ts wrong ?
Does not work with the following VBScript code .
<script Language="VB" runat="server">
Sub SendToHelpDesk(sender As Object, e As EventArgs)
Dim V_DGI AS DataGridItem
Dim chkSelect As System.Web.UI.WebControls.CheckBox
For Each V_DGI in gridx.Items
chkSelect=CType(V_DGI.FindControl("CHK"),CheckBox)
If chkSelect.Checked then
h_req_id.value=CType(V_DGI.FindControl("req_id"),Label).Text
End If
Next
Server.Transfer("rqstDisplay.aspx")
End Sub
</script>
There's no error, but the value stored in h_req_id.value is blank.
Tried solving the same problem with javascript validation
<script Language=JScript >
function validate()
{
if(document.getElementById("<%=CHK.ClientID%>").checked==true)
{alert("JSCript");}
}
</script>
The above code gives the following error : BC30451: Name 'CHK' is not declared.
My HTML Form
<asp:TemplateColumn HeaderStyle-HorizontalAlign=Center HeaderText="X">
<ItemTemplate>
<asp:Checkbox ID="CHK" Runat="server" />
<asp:Label ID="req_id" Visible="False" Text='<%# DataBinder.Eval(Container.DataItem,"request_id") %>' Runat=server />
</ItemTemplate>
</asp:TemplateColumn> <input type=hidden name=h_req_id>
anyone haveany idea wh'ts wrong ?