validate link only if value is non empty

This commit is contained in:
Anand Doshi
2012-07-31 19:37:39 +05:30
parent 5c42d5d2cf
commit dc40385d41
2 changed files with 4 additions and 4 deletions

View File

@@ -110,7 +110,7 @@ LinkField.prototype.set_input_value=function(val){var me=this;me.set_input_value
if(cur_frm){if(val==locals[me.doctype][me.docname][me.df.fieldname]){me.run_trigger();return;}}
me.set(val);if(_f.cur_grid_cell)
_f.cur_grid_cell.grid.cell_deselect();if(locals[me.doctype][me.docname][me.df.fieldname]&&!val){me.run_trigger();return;}
me.validate_link(val,from_selector);}
if(val){me.validate_link(val,from_selector);}}
LinkField.prototype.validate_link=function(val,from_selector){var me=this;var fetch='';if(cur_frm.fetch_dict[me.df.fieldname])
fetch=cur_frm.fetch_dict[me.df.fieldname].columns.join(', ');$c('webnotes.widgets.form.utils.validate_link',{'value':val,'options':me.df.options,'fetch':fetch},function(r,rt){if(r.message=='Ok'){if($(me.txt).val()!=val){if((me.grid&&!from_selector)||(!me.grid)){$(me.txt).val(val);}}
if(r.fetch_values)