generating pop up on another page when form is submitted? - javascript

i have 2 pages in jsp. 1 is doctor.jsp and the other is patient.jsp. Both pages are open in 2 different pc and have different views. what i want to do is that when patient form is submitted the patient.jsp is refreshed but data of form move to doctor page and a pop-up of div is generated in doctor.jsp. but the patient view remains as it is and just a pop-up is generated in doctor.jsp.

For pushing information to a page using jquery check out the Atmosphere framework. You'll need both server and client side code to handle the transactions, and Atmosphere can make it a lot easier. I haven't used it in regular jsp but perhaps this article is a good starting point for you.

Related

Multiple Record Lines

I want to add multiple records in the registration screen. For example, when adding a price menu, there are columns such as "price","menu name","menu description". I want to design a multi-product page and have the user enter more than one record on the same page. I know how to do this while saving it to the database. I am a Net Core expert. But on the razor page side, that is, on the html side, I don't know how to design it. For this, if there is a javascript module or library that will make my job easier, could you please share it with me? What I need is an html page with multiple data entries.

Embedding a form and posting it to another site

Had a question around forms and posting data to other web sites. The website in question has a donation form I would like to utilize - and they are serving as a fiscal sponsor for a company I work for. Currently we have to link to their form and guide our users on how to donate through them. I want to embed their form on our site so as to skip the step of linking to their form and make it easier on our users.
I first started with simply copying their forms' HTML verbatim but when I click the submit button to submit a donation, it takes me to their "cart" page and there is nothing in the cart.
So I'm not sure what else to try
The cart refers to an object in session. Simply copying the HTML will not enable the add to cart of other site.
In this case must redirect the user to other site. Or you can use an iframe for embedding the other page in your site.

Changing the contents of HTML page depending on options on navbar

I'm making an administrator portal for a band-website. The design is as follows:
There is a side navigation bar(on the left of the page), with things to be done (such as verify reservation requests, answer fanmails, modify band info, upload photographs to the gallery etc.). Clicking on these options should populate a form in the empty space on the right. I don't want to create a separate page for every one of them.
I have checked hell lot of websides for side navs, but i see they all redirect to links to different pages. If anybody could suggest me what all i should explore.
What you are asking about is called 'Single Page Application'. You need to use JavaScript for this. Best way is using JavaScript MVC frameworks like Angular, Ember, React etc.

Setting a popup to only appear if the user hasn't submitted the form in the popup

I'm not sure how best to approach this, but this project would require a popup to appear. The popup would display an iframe that has a donation form linked to an external database. Ideally, this popup would only appear if the visitor has not yet donated.
Since I don't have direct access to this external database (form is provided by the client), I thought, maybe, the popup could utilize HTML localStorage (found a working demo here) taking it a step further to check if that form had been submitted (storing info from the form action?) for that visitor. This stored cookie would then expire every 6 months.
Is this even possible or is there a better way to accomplish this?

How to create a modal form on html static pages to store users in rails

I'm trying to show a modal form window into some static html pages to request a users information and connect this with a Rails application.
I have a dynamic Rails application that save the user's information with a gem Devise in the side of my server.
The creation of modal windows in Rails with Bootstrap seems simple but I do not know if that view can be embedded as javascript into the static pages or if should create the modal form directly in the static page for later send user data to my application rails.
Any ideas would be greatly appreciated. Thanks in advance.
You've got three options:
A) render the html for the form out in advance in a hidden div, then just copy that into the modal.
B) construct the form in javascript, perhaps using a sort of "blank" form with a few missing details, then render the result into the modal
C) use javascript to make a call to the rails back end (which supplies the form html), and when you get it, load it into the modal.
Which choice you use depends on how much dynamic content is in your form. C is the slowest option but simplest in a way since your form will always be built from scratch in rails, which can use the appropriate data. This is suited to a situation where you are looking at lots of records on the page, each of which has a lot of data, and you want to click on one to edit some of the data.
If, for any given page, the form can be generated in rails on initial page render, then you could do A as all of the dynamic elements will be available in your controller in the first place. This is well suited to a page where you are looking at a single record, and want to show an edit form in the modal: because there is only one record to choose between, you always know in advance how to make the form for it.
B is sort of a half-way stage: if you don't know in advance what you will need to load into the form, but the difference between the form "options" is very small then you could fill in the blanks with JS. This is probably the most complicated solution as you'll need to write the JS yourself, but it's more efficient than C.

Categories

Resources