select - Assistance with jquery dropdown list -
i took jquery select list friend need alter , inquire problem. entire page:
<html> <head> <title></title> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <meta name="keywords" content="" /> <meta name="description" content="" /> <script type="text/javascript"> $(document).ready(function() { $('.openselect').change(function(){ if ($(this).val()) { window.open($(this).val(), '_blank'); } homecoming false; }); }); </script> </head> <body id="bo"> <br /> <br /> <table border="0" cellspacing="0" cellpadding="0"> <tr><td> <div id="table"> <table class="sortable" border="0" cellspacing="0" cellpadding="0" width="790"> <tr id="head"><td>col1</td><td>col2</td><td>col3</td><td>col4</td><td>col5</td><td>col6</td><td>col7</td> <td>col8</td><td>col9</td><td>col10</td></tr> <tr><td>col 1</td><td>col 2</td><td>col 3</td><td> <form style="padding-bottom:5px; margin:0px"> <select class="openselect" style="width:120px; color:#0066ff;"> <option value="#">item 1 <option value="#">data item 1 <option value="http://www.google.com/">data item 1 google <option value="http://www.yahoo.com/">data item 1 yahoo </select> </form> </td><td>col 5</td><td>col 6</td><td>col 7</td><td>col 8</td><td>col 9</td><td>col 10</td></tr> <tr><td>col 1</td><td>col 2</td><td>col 3</td><td> <form style="padding-bottom:5px; margin:0px"> <select class="openselect" style="width:120px; color:#0066ff;"> <option value="#">item 2 <option value="#">data item 2 <option value="http://www.google.com/">data item 2 google <option value="http://www.yahoo.com/">data item 2 yahoo </select> </form> </td><td>col 5</td><td>col 6</td><td>col 7</td><td>col 8</td><td>col 9</td><td>col 10</td></tr> <tr><td>col 1</td><td>col 2</td><td>col 3</td><td> <form style="padding-bottom:5px; margin:0px"> <select class="openselect" style="width:120px; color:#0066ff;"> <option value="#">item 3 <option value="#">data item 3 <option value="http://www.google.com/">data item 3 google <option value="http://www.yahoo.com/">data item 23 yahoo </select> </form> </td><td>col 5</td><td>col 6</td><td>col 7</td><td>col 8</td><td>col 9</td><td>col 10</td></tr> </table> </div> </td></tr></table> </body> </html>
problem script error “the value of property ‘$’ null or undefined, not function object” comes when trying preview page in html kit. works ok online thought why script error?
change needed want new page open when lastly 2 options chosen (data item x from…) nothing, if possible not reload page, when options “item x” , “data item x” chosen. know activation of “_blank” needs alter don’t know how it...
thanks
thanks, read post linked , wanted ask, worthwhile creating alert 1 of guys suggests? if yes, have suggestion on how add together in script above? again!!
the simplest solution adding alert popup custom text after trying open new tab 1 of guys suggests :
$('.openselect').change(function(){ var selectedvalue=$(this).val(); if (selectedvalue.match(/http/)) { var open = window.open($(this).val(),'_blank'); if (open == null || typeof(open)=='undefined'){ alert("turn off pop-up blocker!\n\nwe seek open next url:\n" + selectedvalue); } } });
but dont scheme popups , think more userfriendly customized popup section, instance, jquery ui dialog
jquery select dropdownbox
No comments:
Post a Comment