Jump to content
rizwansyed

Back button press

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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.

 

 

Share this post


Link to post
Share on other sites

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

×