Jump to content

Back button press


rizwansyed

Recommended Posts

Hi

Whenever i click on submit button,It goes to other page as shown in attached figure.

Is there any option to automatically press back button of browser or the back option after 1 second as shown in the attached image.

Please suggest

 

Thanks and Regards

Rizwan Syed

back_button.PNG

Link to comment
Share on other sites

Hi

I have a board reneses synergy s7g2 board.

Please find the attached Submit button file in html which has  a html snippet.

I have a list of languages which can be selected from drop down list and then i press submit button so that i can receive the selected language on my board.

I have a code in my c file in renesas baord  with    else if ((NX_HTTP_SERVER_POST_REQUEST == request_type) && (0 == strcmp(resource, "/language")))

It compares with my Html file code like <form action="/language" method="post">

So whenever i press submit button, it goes to other page like 192.100.5.45/language.So i want to avoid going to next page .

 

My requirement is, when ever i submit, it should be in same page or if it goes to other page , i need a workaround like automatically coming back to default page with in a second.

Please suggest

Thanks and Regards

Rizwan Syed

submit buttton code.txt

Link to comment
Share on other sites

I second AJAX for this one.

Otherwise, if you want to end up on the same page for submission, you could:

A: Redirect using your back-end code (on your /language page handling, with headers or however you wish to do it)
B: Make sure that your form `action` targets the page its on. With this one you'll need to make sure your form handling back-end code also watches this form for submissions.

Link to comment
Share on other sites

1 hour ago, rizwansyed said:

We need HTML only, as customer dont need any other language except HTML

You can't, you at very least require JavaScript, using JavaScript you can use

            
    window.onload=function(){
            setTimeout(function() {
                window.location.href = "whereever.html"; //will redirect to your required page
            }, 1000);

    }

on the page it lands on.

The form needs to submit using default method, or JavaScript through AJAX where form values are sent using JavaScript/script code (that can read the post value usually server script such as PHP) as post/get to wherever, to process as it normally would, without the need to leave the form page.

 

 

Link to comment
Share on other sites

13 hours ago, rizwansyed said:

Hi 

We need HTML only, as customer dont need any other language except HTML

but is any alternative , so that we can avoid going to other page also....just submit and be in same page

 

Inside `form-page.html` just make the form action the page you're on. That will submit it to the same page.

<form action="/form-page.html">
  <!-- All the inputs -->
</form>
Link to comment
Share on other sites

That won't work because in that situation it processes (using server side language) the submitted content and depending if it validates it goes on to do other things like redirect, send email etc else It will keep on looping to the same form otherwise. It seems you need to submit to c file located at /language and and retrieve the post data from form. The older html meta redirect is then your only option.

<meta http-equiv="refresh" content="1; url=http://whatever/form-page.html">

 

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...