Click here to Skip to main content
15,886,795 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I got form in html page as given below
HTML
<form id="frmsubmit" action="senddoc.aspx" method="post" 
 önsubmit="return validate();">
<input type="text"  önchange="CopyMe(this, 'textfield');" />

<input id="btnsubmit" type="submit" value="SUBMIT" />
</form>

I want to restrict redirect to senddoc.aspx but need to submit form data
is der any way

many thanks
Posted
Updated 6-Jun-12 0:39am
v2
Comments
Member 15627495 11-Jun-22 2:40am    
to achieve a loading of datas from a page to itself you need AJAX query.
It's asynchronous call from a page without reloading the entire page.

you can act on all dom of your page using a Js .html() .append .prepend , or just on the content/tags of your choice.


if you want to achieve a submit,
you can do :
<form action="?" method="get/Action/....">


because it's the same page.
you put your php in this page to handle the form submit and it's done ( but this type of call will make your page reloading once ).


AJAX : the page loads datas.
action="?" : the page reload itself , but with new datas to come. the action target is the same page ( from == to ).

1 solution

I doubt you can - it's not possible.

The required action attribute specifies where to send the form-data when a form is submitted. Thus, when form is submitted it, action would occur.
Refer: W3Schools: HTML <form> action Attribute[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900