1

I run the next script on IE and Nightly without any problems. But chrome wont run it for some reason...any Ideas ?

<script>
$(function() {
         $('#date').datepicker({
            dateFormat: 'yy-mm-dd',
            autoSize: true,
            onSelect: function (dateText, inst) {
            $(this).parent('#frmDate').submit();
            }
        });
    });
</script>

<form id="frmDate" action="php/price_qury.php" method="post" target="_blank" onSubmit='window.open("width=450,height=300,status=yes,resizable=yes,scrollbars=yes)'>
      <input id="date" name="date" type="text"   size="10">
  • 2
    Start by checking the console. – Kevin B Oct 11 '13 at 22:12
  • 1
    What do you mean by "doesn't run"? This works for me in Chrome: http://jsfiddle.net/ePxGy/ It's doing an alert instead of submitting the form since I don't have access to your actual form. Is the issue you are having with the form itself? – mayabelle Oct 11 '13 at 22:12
  • possible duplicate of [jQuery datepicker, onSelect won't work](http://stackoverflow.com/questions/887696/jquery-datepicker-onselect-wont-work) – nietonfir Oct 11 '13 at 22:25
  • I am using chrome and the fiddle worked for me too. – Touch Oct 11 '13 at 22:25
  • Here is the issue in a JSFiddle, my last comment didn't add it properly - copy paste fail :( http://jsfiddle.net/KyleMuir/JHUD7/4/. – Kyle Muir Oct 11 '13 at 22:32

2 Answers2

0

Since you say that it runs on IE, I will assume it works.

I once had a similar problem where my code ran in firefox on Linux but refused to run on windows (google chrome). After hours of trying to figure out what could be wrong, I finally replaced the jquery dollar sign with the word "jQuery".

From:

$(function() {

To:

jQuery(function()) {

This worked for me because in my case it was a conflict problem I think. From what I read, the dollar symbol could have been used by another javascript library.

Checkout this question out:

Replace “$”(dollar Sign) with “JQuery”

If it doesn't work, then I guess you will have to wait for someone to try come up with another solution for you.

Edit: That is how my problem got solved, don't know if you have the exact same issue.

Community
  • 1
  • 1
Touch
  • 1,481
  • 10
  • 19
0

Found the issue:

<form 
 id="frmDate" 
 action="php/price_qury.php" 
 method="post" 
 target="_blank" 
 onSubmit='window.open("width=450,height=300,status=yes,resizable=yes,scrollbars=yes)'>

There is no closing quotation mark in your onSubmit. Fix that and you're golden :)

Should be:

<form 
 id="frmDate" 
 action="php/price_qury.php" 
 method="post" 
 target="_blank" 
 onSubmit='window.open("width=450,height=300,status=yes,resizable=yes,scrollbars=yes")'>

Fiddle: http://jsfiddle.net/KyleMuir/JHUD7/5/

Hope this helps!

Kyle Muir
  • 3,875
  • 2
  • 22
  • 27