File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does the jQuery val() function not work in IE7 & IE8

 
Rob Dennett
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some code where I am setting the value of a hidden input using jQuery's val function: $('#myInputId').val(theNewVal); When I step through with the debugger, $('#myInputId').val() has the new value in it.

After the function is complete, some other code is getting triggered (it's in the handler for $('#theForm).submit()) and when I set a breakpoint on the first line, $('#myInputId').val() has the old value in it. What gives? This works fine in other browsers, BTW. I implemented a work around by also setting the text of a hidden span and setting the value of the input on the first line of the submit handler, but this is truly annoying.

Thanks,
Rob
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not any problem that I've seen or heard wind of. Are there other handlers that may firing that are performing an assignment or doing a form reset?
 
Rob Dennett
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, I forgot about the reset. I will make that change, but why does it work in other browsers? Do they not reset hidden fields?

Thanks,
Rob
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic