Jump to content

Back button press


Recommended Posts


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 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

            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:


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 -->
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...