> when the user presses submit button i want only that form results to be displayed…
> i want to display the form results without reloading the page
>in some cases the forms are interlinked, i.e only after getting the output of first form the second form should be displayed…
>if possible give d code…
Yes - an AJAX request to the server will allow that to occur.
In that case, you would want to check that the first form has the required information. If it doesn’t, then you should hide the second form.
That sort of check should also occur each time the first form is changed.
The code for what? For both of them?
Using which sort of code library, or none?
Do you have any other existing code that does some of the work for you?
How important is it that it works in older web browsers?
Because a viable solution could just the following:
thanks for ur reply…
ya code for both…
i have used lil bit php and html but never used jquery or ajax so having prob und…
der r many line of php code, mysql queries that need to be performed once any of the button is clicked…
most of the forms load in the same page except a few…
like im using if($_POST)
which finds if the button is clicked and my php code goes inside that…
in ur code wer will my php code go ?
But the main point being made there is that the solution to a complex problem can be simple in the how it’s used, thanks to other supporting code that helps it to do the work that’s needed.
> and code needed to execute for form name=‘id’ and name=‘name’ will be in updateid.php and checkname.php
> ive guessed evrything so pls correct if im wrong
> one more thing in .ajax(‘checkname.php’, updateFormName) , dont we need to give full pathname of the file ? or where d file is supposed to uploaded ?
Nope - it takes care of none of those four points. Not by itself anyway. That code is just an example for the purpose of demonstrating how simple things can be when conditions are perfect. Your conditions are not perfect, so things are going to be a lot more complex for you.
Those were just examples. The identifiers that you should use on your own code should be with the intention to make it extremely clear about what those forms are being used for.
If a form accepts a username and password, then “login” would be a good identifier for it.
The path can be specified as being relative to the page, or it can be specified as an absolute path. Using a relative path helps to keep things more flexible.
I suggest that for now - you ignore the other aspects of what you want to achieve, and focus only on the one task - that being to submit the first form as an ajax request.