Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

Javascript to get selected text from Dropdown not working.

$
0
0

Hi,

I have a sharepoint list where in I have a list and a dropdown within the list.

I have written a Jquery to get selected text from the dropdown but its not working. Below is the script.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script><script language="javascript" type="text/javascript">
 
function PreSaveAction() {

var a = $('select[title="Type Of Travel"] option:selected').text();
var e = $('select[title="Levels"] option:selected').text();

alert(a);
alert(e);

}
  </script>


Regards, Shreyas R S


Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>