Hello,
I have a javascript grid on my ASP page which displays information about the history of specific units produced in our manufacturing facility. One of the results is the order number on which the unit was shipped. If the unit was not shipped, obviously there is no order number; the default value of this field on the data table is 0.
Herein lies the problem; if the order number is 0, I do not want the grid to display anything. If the order number is not 0, I want it to display the order number as a hyperlink to the order.
I have been able to do one or the other, but not both. I can display the order number as a hyperlink. OR by calling a vbscript function, I can test the order number, and if it is 0, I can omit it from the grid.
However, I have had no success in trying to get the vbscript function to spit out a hyperlink if the order number is not 0. It seems I am close, but I can't get it formatted just right for input into the javascript code for the grid.
Here is the line of code from the javascript grid:
Here is the vbscript function:
Here is the error the page returns:
I have tried a mix of single and double quotations, etc. to try to get the hyperlink to feed properly into the grid code, but no such luck.
Here is the original working code from the javascript grid which did not test for the result of 0:
Help...?
I have a javascript grid on my ASP page which displays information about the history of specific units produced in our manufacturing facility. One of the results is the order number on which the unit was shipped. If the unit was not shipped, obviously there is no order number; the default value of this field on the data table is 0.
Herein lies the problem; if the order number is 0, I do not want the grid to display anything. If the order number is not 0, I want it to display the order number as a hyperlink to the order.
I have been able to do one or the other, but not both. I can display the order number as a hyperlink. OR by calling a vbscript function, I can test the order number, and if it is 0, I can omit it from the grid.
However, I have had no success in trying to get the vbscript function to spit out a hyperlink if the order number is not 0. It seems I am close, but I can't get it formatted just right for input into the javascript code for the grid.
Here is the line of code from the javascript grid:
Code:
Grid1.colData[8] = 'shipped(rsProduction.fields.getValue(\'Order_No\'))';
Code:
function shipped(order_no) if order_no=0 then shipped="" else shipped=""<A HREF=Historical_Order.asp?Order_No=" + rsProduction.fields.getValue(\'Order_No\') + ">" + rsProduction.fields.getValue(\'Order_No\') +"</a>"" end if end function
Code:
[size=2] [/size] Microsoft VBScript compilation [font=Arial][size=2]error '800a0401'[/size][/font][font=Times New Roman][size=3] [/size][/font] [font=Arial][size=2]Expected end of statement[/size][/font] [font=Arial][size=2]/BatchReportInfotest.asp[/size][/font][font=Arial][size=2], line 528[/size][/font] shipped=""<A HREF=Historical_Order.asp?Order_No=" + rsProduction.fields.getValue(\'Order_No\') + ">" + rsProduction.fields.getValue(\'Order_No\') +"</a>""-------------^
Here is the original working code from the javascript grid which did not test for the result of 0:
Code:
Grid1.colData[8] = '"<A HREF=Historical_Order.asp?Order_No=" + rsProduction.fields.getValue(\'Order_No\') + "> " + rsProduction.fields.getValue(\'Order_No\') +"</a>"';
Comment