We have a customized asp.net web form page (generated by sharePoint). The page has been customized with a button that opens up a window using javascript to a second asp.net page for a search and asp.net gridview selection process. Perhaps the platform is not important, but that second page gemerates javascript on the fly to send selected information from the selected itemon the grid to first page’s form form fields. That code is below and does work great.
Can somebody suggest a jquery alernative to this? Will I need a jquery addin if using jquery from Google’s site.
Ideally what we want is to pop up a window that allows us to search an external datasource and then select from entries found and automatically fill sharepoint form columns. the javascript code we have does work.
<a href="javascript:PS=window.open('PS.aspx','PS','width=800,height=600,scrollbars=1');PS.focus()">
CLICK HERE TO SEARCH FOR PHYSICIAN
</a>
<script language="VB" runat="server">
Protected Sub PhysicianGrid_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles PhysicianGrid.SelectedIndexChanged
'session("firstname") = PhysicianGrid.SelectedRow.Cells.Item(2).Text
Dim strjscript as string = "<script language=""javascript"">"
strjscript = strjscript & "passvalue('lastname','"+PhysicianGrid.SelectedRow.Cells.Item(1).Text+"');"
strjscript = strjscript & "passvalue('firstname','"+PhysicianGrid.SelectedRow.Cells.Item(2).Text+"');"
strjscript = strjscript & "passvalue('Phone','"+PhysicianGrid.SelectedRow.Cells.Item(8).Text+"');"
strjscript = strjscript & "<" + "/script>"
Literal1.text = strjscript
End Sub
</script>
window.openeris an object that points at whatever window/tab opened the current window. You shouldn’t have to generate javascript on the fly to pass values back and forth. A simpleshould do the trick of setting those values in the parent window, and then a function call to indicate to the parent that the data’s available:
The same goes for passing data from the parent to child windows: