|
I have an .aspx from that is serving as a popup and populating textboxes on another form through the javascript below. I'm needing a way to on either screen to avoid a " " from appearing for Nulls. Any ideas? Maybe "IF val1 == " "... "" Else.... "(?) Thanks!:
<script language="javascript">
function GetRowValue(val1, val2, val3, val4, val5, val6) {
window.opener.document.getElementById("txtEndUserLastName").value = val1;
window.opener.document.getElementById("txtEndUserFirstName").value = val2;
window.opener.document.getElementById("txtEndUserMiddleName").value = val3;
window.opener.document.getElementById("txtUserLanId").value = val4;
window.opener.document.getElementById("txtEndUserLocation").value = val5;
window.opener.document.getElementById("txtEmail").value = val6;
window.close();
}
</script>
<script runat="server">
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles Gridview1.RowDataBound
If (e.Row.RowType = DataControlRowType.DataRow) Then
DirectCast(e.Row.FindControl("btnSelect"), Button).Attributes.Add _
("onclick", "javascript:GetRowValue('" & e.Row.Cells(1).Text & "','" & e.Row.Cells(2).Text & "','" & e.Row.Cells(3).Text & "','" & e.Row.Cells(4).Text & "','" & e.Row.Cells(5).Text & "','" & e.Row.Cells(6).Text & "')")
End If
End Sub
</script>
modified 11-Feb-13 10:46am.
|
|
|
|
|
was thinking something like this would work but it may need some modification to work (?):
window.opener.document.getElementById("txtEndUserLastName").value = (val1 == " " ? "" : val1);
|
|
|
|