•
•
•
•
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 397,594 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,835 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: 785 | Replies: 7
![]() |
•
•
Join Date: Feb 2008
Posts: 40
Reputation:
Rep Power: 1
Solved Threads: 0
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...
thanks ahead...
Daniel
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...
javascript Syntax (Toggle Plain Text)
function go() { document.one.submit(); } function gogo() { document.two.submit(); } function gogogo() { document.three.submit(); } <form name="one" > <select name="oneone" id="oneone" onchange="go()"> </select> </form> <form name="two" > <select name="twotwo" id="twotwo" onchange="gogo()"> </select> </form> <form name="three" > <select name="threethree" id="threethree" onchange="gogogo()"> </select> </form> <form name="four" action="ComputeAndReturn" > <input type="submit" value="Add" name="Add" /> </form>
thanks ahead...
Daniel
Last edited by vedmack : Mar 5th, 2008 at 5:38 am. Reason: Added more details....
•
•
Join Date: Jan 2008
Location: Bangalore, India
Posts: 331
Reputation:
Rep Power: 0
Solved Threads: 31
•
•
Join Date: Feb 2008
Posts: 40
Reputation:
Rep Power: 1
Solved Threads: 0
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?
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?
•
•
Join Date: Jan 2008
Location: Bangalore, India
Posts: 331
Reputation:
Rep Power: 0
Solved Threads: 31
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.
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
~Mitch Ratcliffe
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."
"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."
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: form validation
- Next Thread: Embedding a PHPBB forum into your website : Problems/Solutions



Linear Mode