views:

32

answers:

2

i have dropdown named po_no with same id which is coming from ajax file

in po_no getting two values in the format of 1025*3

when i put validation on that dropdown in javascript i write this code

if(document.getElementById('po_no').value=="")
  {
 alert("Choose Purchase Order Number");
 return false;
  }

but this code does not work plz give me ideas

A: 

Does your JavaScript run after "po_no" is added to the DOM? If it runs before, then "document.getElementById('po_no')" will return null.

Oxyrubber
A: 

try these

var selObj = document.getElementById('selSeaShells');

if(selObj.options[selIndex].value=="") { alert("sadAS"); }

REFER

http://www.mredkj.com/tutorials/tutorial002.html

zod