• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem setting form Action name Dynamically on button click

 
Hemant Thard
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I have an application where i have to change the form action dynamically(using JS) on click of submit button(type=submit).
i have written a simple code to do so.


this works fine with Firefox 3.6 , but with IE 8, i am getting error and am not able to proceed further.

Ieven tried using Jquery, but the result is same.


Can someone help me to figure out what is wrong with the above code.

Regards,
Hemant


 
Paul Clapham
Sheriff
Pie
Posts: 20161
24
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not JSP, that's Javascript. We have a forum for that. Moving...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use tools improperly, of course things do not work.


 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
get() returns the DOM element, you are treating it as a jQuery object.

You want to use eq()

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, the preferred solution would be to give the form an id and use it to directly find the element.
 
Hemant Thard
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Thanks for the reply.

I tried everything
Here's my form


but this doesn't seems to work. All i got is Object doesn't support this property.

then i did some googling and i found this.

this article says some element properties has been removed from IE 7-8(including one i am looking for ).

but date of this article concerns me. its dated back to Nov 05 2010. I thing IE might has resolved this problem till now.

can anyone please confirm me or what alternate solution do i have.


Regards,
Hemant
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That article has nothing to do with anything unless you are using TinyMCE.

Which statement and which property is causing the issue.
 
Hemant Thard
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Bear,

thanks for reply.

This statement which gives me object doesn't support this property.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using jQuery, why aren't you using jQuery to do this?
 
Hemant Thard
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried using that but with no success ..

i tried all the way i mentioned on my previous message.

 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you getting errors in the console?

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pick one way, and create an SSCCE that shows the issue. Does this happen on all browsers, or just one?
 
Hemant Thard
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Sorry for late reply.

Yes Bear, it happens for IE8. it works fine for Mozilla 3.6.

Yes, i created a small SSCCE and it worked fine in IE 8.(thanks for suggesting me that) .

but still i don't understand what the problem might be.
Its an existing application on which i am doing some modification.

i tried all known way


and still i am getting error "object does not support this property".


since this was some urgent deployment time issue, i had to look some alternate way.

but i still wonder what the problem might be. Is it because of CSS or something else.


any suggestion .. ?


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are still doing it two ways. Pick one. One. Just one. Only one.

And, the forms[0] approach when out of vogue in 1998, so guess which one you should concentrate on?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic