Rattlesnake
Freshman
- Joined
- Dec 23, 2003
- Messages
- 47
Hi,
I have a datagrid that has column with a textbox that is used to enter a product description. There is a Hyperlink in the same column when clicked opens a pop-up window , that contains a datagrid with a list of available product descriptions. When the user selects a product description it is supposed to be returned to the textbox in the datagrid of the calling window.
I have the following code in the Datagrid_SelectedIndexChanged of the pop-up window
SelectedProd = dgSuppliers.SelectedItem.Cells(1).Text
SelectedCost = dgSuppliers.SelectedItem.Cells(3).Text
I have a HTML button in the pop_window that calls the following Javascript function
function SetProd()
{
window.opener.document.forms["<%= FormName %>"].elements["<%= ControlName %>"].value = "<%= SelectedProd %>";
window.opener.document.forms["<%= FormName %>"].elements["<%= ControlName2 %>"].value = "<%= SelectedCost %>";
window.close();
}
Where FormName and ControlName are predefined.
This works fine when I select single line product descriptions from the datagrid.
It gives me a javascript error when a multiline prod. description is selected.
I have tried replacing the VbCrLf character with "<br>" in the SelectedProd string , but when the string is returned to the textbox in the calling window , it appears as
Line<br>Line2<br>Line3<br>Line4
I want them to appear on different line.
How can I return the multiline prod description to the calling form and make it appear in seperate lines.
Thanks
I have a datagrid that has column with a textbox that is used to enter a product description. There is a Hyperlink in the same column when clicked opens a pop-up window , that contains a datagrid with a list of available product descriptions. When the user selects a product description it is supposed to be returned to the textbox in the datagrid of the calling window.
I have the following code in the Datagrid_SelectedIndexChanged of the pop-up window
SelectedProd = dgSuppliers.SelectedItem.Cells(1).Text
SelectedCost = dgSuppliers.SelectedItem.Cells(3).Text
I have a HTML button in the pop_window that calls the following Javascript function
function SetProd()
{
window.opener.document.forms["<%= FormName %>"].elements["<%= ControlName %>"].value = "<%= SelectedProd %>";
window.opener.document.forms["<%= FormName %>"].elements["<%= ControlName2 %>"].value = "<%= SelectedCost %>";
window.close();
}
Where FormName and ControlName are predefined.
This works fine when I select single line product descriptions from the datagrid.
It gives me a javascript error when a multiline prod. description is selected.
I have tried replacing the VbCrLf character with "<br>" in the SelectedProd string , but when the string is returned to the textbox in the calling window , it appears as
Line<br>Line2<br>Line3<br>Line4
I want them to appear on different line.
How can I return the multiline prod description to the calling form and make it appear in seperate lines.
Thanks