User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 361,626 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,218 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 669 | Replies: 7
Reply
Join Date: Feb 2008
Posts: 34
Reputation: vedmack is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
vedmack vedmack is offline Offline
Light Poster

Forms without action "imitate" of other Form (which do have action) ???

  #1  
Mar 5th, 2008
I have a very weired problem (which is not easy to describe.. but I'll do my best):
I have a html page with several forms , only one of the got the action="ComputeAndReturn" and the other forms got only name="" tag...

the problem is that after i submit the form with the action , and than after a computatioon it returns to the original page, now... if i will submit any of the forms without the action=...

they will act as if they were defined action="ComputeAndReturn" (altho they are not!)

Now... if they were defined from the first time with action="anything", and than i would submit the form with action="ComputeAndReturn" this problem would not appear (the other forms will keep their action="anything" and would not "imitate" the action="ComputeAndReturn" to them selfs...

any ideas how can i keep my forms without action="" , cause all i need them to do is be submitted to pass the submitted value to other form inside that page....

it looks something like this...

  1. function go()
  2. {
  3. document.one.submit();
  4. }
  5.  
  6. function gogo()
  7. {
  8. document.two.submit();
  9. }
  10.  
  11. function gogogo()
  12. {
  13. document.three.submit();
  14. }
  15.  
  16. <form name="one" >
  17. <select name="oneone" id="oneone" onchange="go()">
  18. </select>
  19. </form>
  20.  
  21. <form name="two" >
  22. <select name="twotwo" id="twotwo" onchange="gogo()">
  23. </select>
  24. </form>
  25.  
  26. <form name="three" >
  27. <select name="threethree" id="threethree" onchange="gogogo()">
  28. </select>
  29. </form>
  30.  
  31.  
  32. <form name="four" action="ComputeAndReturn" >
  33. <input type="submit" value="Add" name="Add" />
  34. </form>
  35.  

thanks ahead...

Daniel
Last edited by vedmack : Mar 5th, 2008 at 5:38 am. Reason: Added more details....
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2008
Location: Bangalore, India
Posts: 327
Reputation: DangerDev is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 31
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Whiz

Re: Form without action "imitate" of other Form (which do have action) ???

  #2  
Mar 5th, 2008
hi
i am not getting same problem as you are getting as i tried, any way you try to put action="#"
hope it will help..!
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila.
~Mitch Ratcliffe
Reply With Quote  
Join Date: Feb 2008
Posts: 34
Reputation: vedmack is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
vedmack vedmack is offline Offline
Light Poster

Re: Form without action "imitate" of other Form (which do have action) ???

  #3  
Mar 5th, 2008
I did tried action="#" , but it doesn't change anything... still the other forms tries to act as if they were defined with action="ComputeAndReturn"

i know that a part of the blame that this all happening is of ComputeAndReturn which is a servlet that returns something that messing all that html... but i'm looking for a solution that i will be able to apply on the html side only...

any other ideas?
Reply With Quote  
Join Date: Jan 2008
Location: Bangalore, India
Posts: 327
Reputation: DangerDev is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 31
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Whiz

Re: Form without action "imitate" of other Form (which do have action) ???

  #4  
Mar 5th, 2008
instead of calling ComputeAndReturn directly can't you call a jsp file there you will take care of calling ComputeAndReturn.
you can also have hidden field on all the form with same name and at jsp file you can check the value of hidden field and on the basis of perform correct action.
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila.
~Mitch Ratcliffe
Reply With Quote  
Join Date: Feb 2008
Posts: 34
Reputation: vedmack is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
vedmack vedmack is offline Offline
Light Poster

Re: Form without action "imitate" of other Form (which do have action) ???

  #5  
Mar 5th, 2008
thx 4 the suggestion ,but it doesn't fit my needs , cause i need to receive some data back from the servlet and to show it ....
Reply With Quote  
Join Date: Jan 2007
Posts: 2,354
Reputation: MidiMagic is on a distinguished road 
Rep Power: 6
Solved Threads: 89
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Posting Maven

Re: Form without action "imitate" of other Form (which do have action) ???

  #6  
Mar 7th, 2008
I use action=none when I don't want any submission.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,689
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 312
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: Form without action "imitate" of other Form (which do have action) ???

  #7  
Mar 8th, 2008
form.submit() causes a form submit irrespective of whether that form has been assigned a real or dummy action. Plus on a page at a time only one form can be submitted. The best way here would be to rethink your design and encapsulate all the elements in the same form and perform the arbitration logic at the server itself.
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Join Date: Feb 2008
Posts: 34
Reputation: vedmack is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
vedmack vedmack is offline Offline
Light Poster

Re: Form without action "imitate" of other Form (which do have action) ???

  #8  
Mar 8th, 2008
action=none doesn't work also... after first form submitting of the "problematic form" all other forms starts to behave like it also.....
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 6:33 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC