I have a JS function that seems to be working fine until a value is added to a hidden text box. The function causes no problems until a value is added to the txt_filepath textbox, which has visibility:hidden style added to it.
I think the problem is linked to the fact that the value in the textbox is in the form of \1\randomletters. I think it's the \'s that are causing the problem. How would I do a replace on them in JS?
The error I get in Firefox is AddTask is not defined.
The JS function is as follows:-
Any ideas?Code:function AddTask(){ var tr_box = document.getElementById('tr_box_start1'); //alert(tr_box); if(tr_box!=null){ document.getElementById('tr_box_start1').style.display='none'; document.getElementById('tr_box_start2').style.display='none'; } document.getElementById('ctl00_main_content_update_progress').style.display=''; document.getElementById('update_text').innerHTML='Adding Task....'; var pcuser = document.getElementById('ctl00_hdn_pcuser').value; var defaulttask = document.getElementById('ctl00_main_content_ddl_defaulttask').value; if(defaulttask=='') defaulttask=0; var visitorref = document.getElementById('ctl00_main_content_ddl_visitorref').value; if(visitorref=='') visitorref=0; var introref = document.getElementById('ctl00_main_content_ddl_introref').value; if(introref=='') introref=0; var cat = document.getElementById('ctl00_main_content_ddl_category').value; var sendto = document.getElementById('ctl00_main_content_ddl_sendto').value; var dtDue = document.getElementById('ctl00_main_content_txt_datedue').value; var tmSpent = document.getElementById('ctl00_main_content_txt_timespent').value; var title = document.getElementById('ctl00_main_content_txt_subject').value; //alert(title); var filepath = document.getElementById('ctl00_main_content_txt_filepath').value; filepath=escape(filepath); alert('filepath: '+filepath); var note=FTB_API['ctl00_main_content_ftb_mess'].GetHtml(); //alert(note); //return false; TaskAdd.AddTask(pcuser,defaulttask,visitorref,introref,cat,sendto,dtDue,tmSpent,title,filepath,note,OnAddTaskComplete,OnError,OnTimeout); }



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks