Help needed: Scripting error

Hi,

The code seem to be working by itself. However it kinda broken when frappe takes it to render. 
Could someone kindly help me out with the following error. I have spend countless hours trying to debug error.


[Error] TypeError: 'null' is not an object (evaluating 'document.getElementById('barcode_div').innerHTML = DrawHTMLBarcode_Code39(cur_frm.docname, 1, 'yes', 'cm', 0, 10, 0.5, 2.2, 'bottom', 'center', '', 'black', 'white')')
 
eval code (undefined, line 4)
 
eval
 run_embedded_js
(frappe.min.js, line 1668)
 render
(frappe.min.js, line 1653)
 build
(frappe.min.js, line 1651)
 
(anonymous function) (frappe.min.js, line 1532)
 dispatch
(jquery.min.js, line 3)
 handle
(jquery.min.js, line 3)
 trigger
(jquery.min.js, line 3)
 
(anonymous function) (jquery.min.js, line 3)
 each
(jquery.min.js, line 2)
 each
(jquery.min.js, line 2)
 trigger
(jquery.min.js, line 3)
 print_doc
(frappe.min.js, line 1537)
 
(anonymous function) (frappe.min.js, line 1790)
 
(anonymous function) (frappe.min.js, line 540)
 dispatch
(jquery.min.js, line 3)
 handle
(jquery.min.js, line 3)

the DrawHTMLBarcode_Code39 function

function DrawHTMLBarcode_Code39(data,
        checkDigit
, humanReadable,
        units
, minBarWidth, width, height, barWidthRatio,
        textLocation
, textAlignment, textStyle,
        foreColor
, backColor)


and help to correct this issue is much appreciated. I have been banging my head against the wall for several day.

Thank you.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/d87b1efd-1411-43cb-abda-b2d60ae19abb%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Can you share you entire script?


On 20-Jul-2014, at 6:05 pm, Nonnatee Kanjana <no...@ps-groups.com> wrote:

Hi,

The code seem to be working by itself. However it kinda broken when frappe takes it to render. 
Could someone kindly help me out with the following error. I have spend countless hours trying to debug error.


[Error] TypeError: 'null' is not an object (evaluating 'document.getElementById('barcode_div').innerHTML = DrawHTMLBarcode_Code39(cur_frm.docname, 1, 'yes', 'cm', 0, 10, 0.5, 2.2, 'bottom', 'center', '', 'black', 'white')')
 eval code (undefined, line 4)
 eval
 run_embedded_js (frappe.min.js, line 1668)
 render (frappe.min.js, line 1653)
 build (frappe.min.js, line 1651)
 (anonymous function) (frappe.min.js, line 1532)
 dispatch (jquery.min.js, line 3)
 handle (jquery.min.js, line 3)
 trigger (jquery.min.js, line 3)
 (anonymous function) (jquery.min.js, line 3)
 each (jquery.min.js, line 2)
 each (jquery.min.js, line 2)
 trigger (jquery.min.js, line 3)
 print_doc (frappe.min.js, line 1537)
 (anonymous function) (frappe.min.js, line 1790)
 (anonymous function) (frappe.min.js, line 540)
 dispatch (jquery.min.js, line 3)
 handle (jquery.min.js, line 3)

the DrawHTMLBarcode_Code39 function

function DrawHTMLBarcode_Code39(data,
        checkDigit, humanReadable,
        units, minBarWidth, width, height, barWidthRatio,
        textLocation, textAlignment, textStyle,
        foreColor, backColor)


and help to correct this issue is much appreciated. I have been banging my head against the wall for several day.

Thank you.




Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/d87b1efd-1411-43cb-abda-b2d60ae19abb%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/A94A5B9B-F1CC-4C8E-BB18-473D3EBF050C%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.