Automatically prefill a webform from Client site - javascript

The Film-Production Software Shotgun offers a web interface.
To write notes, coordinator often have to fill in the same information into the forms, because there is no easy way to pre-fill the form automatically based on a project or page.
How can you prefill an autogenerated form, where you do not have access to the sourcecode of the website, which you would like to alter as a client automaticlly.
This is not trying to achieve, to alter the whole website on the web, rather just trying to alther the users html to improve the speed and remove redundant form entries.
Thanks

It would be possible to store this data in the cookies, although I do not know which implications this would have security wise. Ofcourse this would be much easier if there was a way to store this data server sided and collected from there.
Try creating a dictionary or JSON object based on the form, and store this data in the cookies. collect the data from the cookies if the user lands on the form again. The benefit from this is that you could implement this without ever actually handling the data, and being able to base it on a session so the cookies get cleared once a user drops the page.

Related

How can I equip my site with a "vetting" form?

I want to set up a page within my site that contains a form for a prospective client to fill.
I would then manually inspect the form's results to ensure the prospect is qualified, and then send them a temporary link to another page that expires in a few hours, or perhaps after one click.
Any advice that can help me towards this goal would result in me thinking you were very cool.
Thanks!!
ms
This would be done server side. The general flow would be that you would submit the html form to the server. Place the data from the form into a server side database. Send an email to the site admin, notifying them that an entry has been made. Then build a control panel where they can view entries and approve them. This would then send an email to the form submitter, grant them access etc.
It may be an easier better approach to use a form service that does most of this for you.
Take a look at:
https://www.formstack.com
If you want to code it your self. You could use a framework such as:
https://firebase.google.com/ (Js)
or
https://github.com/expressjs/express (Node js)

how to maintain check boxes state across jsp pages whenever you come back on a page using javascript or jsf without storing it into database

i want my all check boxes checked whenever i come back from other pages, i want to maintain their states across pages using javascript.
I think you are asking how to store state for an individual session between requests. In this case, that state is checkbox values.
You have a choice to make first: do you want to store the data on the client (in the browser) or on your server?
Server Side
You can store this state on the server side with or without a "database" depending on how pedantic you want to be about the term.
If what you want is to avoid configuring an SQL RDBMS, you might find that the built-in storage options from most Java Servlet containers will work. In Tomcat, you can just use your Session objects as normal, but configure a "File Based Store" instead of a "JDBC Based Store." This will store session data to disk in files. Alternatively you can use StandardManager which uses in-memory storage, but does not persist session state across restarts.
Put simply, these will create a Java Map for each JSESSIONID issued by your server, and then keep the maps in memory, on disk, or in a JDBC database. For more information see: https://tomcat.apache.org/tomcat-7.0-doc/config/manager.html
Client Side
Here you have a few options as well. The driving factor is what level of browser you wish to support. If you can tolerate restricting your users to those who use a browser with HTML5 web storage and JavaScript enabled, things are pretty easy. If not, you can accomplish the same thing with a cookie.
The big downside to client-side storage is trust. Users (or software on their computer) can modify client-side storage. This goes for cookies, localStorage, and sessionStorage. Many developers forget this and introduce security vulnerabilities because of it. If this is for a real production web application, you'll want to wrap your state in an authenticator.
Here's a the first in a three article series on a way to convince your servlet container to put session state into cookies in a way that is transparent to your servlets. It is missing authentication, but you can add it by following guidance such as this bit from Rob Winch.
Now What?
Ok. You've decided to use client- or server-side storage for your checkbox values. Now what?
A simple (usually wrong) option is to store the checkbox input names and values in a map:
{"boxFoo": true,"BarBox":false}
The reason this is usually wrong is that it fails to distinguish which form your user was visiting. It means that if you apply this strategy to more than one form on your site, you'll have to worry about name collisions.
The next evolution is to have a structure keyed by form name and then field name. This would be a map like the following:
{ "formA": {"boxFoo": true,"BarBox":false},
"formQ": {"checkAlpha":true,"BetaCheck":false } }
This works, but will have annoying behavior when your users use multiple tabs. You can make that behavior more predictable for your users by using per-tab identifiers -- at the expense of space in your session object -- or by using AJAX to keep the fields in sync -- which has its own perils. Or you can do what most people do an just assume that the last submitted form overwrites the state from all previous ones, tabs be damned. That's much simpler to code, but more annoying to users.
I can propose some ways :
send http params (in hidden field) with check boxes flags which must stay checked in each new page requested by your application . You can factorize it with a function but it stays cumbersome to do.
store the check boxes marker flag in the http session. If the check boxes must stay checked in all the life of your user, it may be a suitable solution. Use may use a backing bean session for it as you use JSF.
Nevertheless, store the minimum of information in it.
store the information in a shared applicative cache to retrieve it. In this way, you stay stateless and you have not the drawback of the session if you use clustering in your servers.
There is maybe better as alternative.
You have to bind the value with a backing bean. As long as the backing bean is having the appropriate scope it will be retained on the page when you navigate to it.

store and load html form data locally

A client wants a web application that performs a calculation based on text inputs, pulldown selections, checkbox selections, etc. They want to persist form data input but they are don't want to store them on the server. Instead they prefer to retain the inputs locally.
I've been searching and determined that this not a standard approach. Then I came across HTML5 Storage but it looks like that option isn't exactly what I thought it was.
Client wants to be able to save and load sets of inputs such as mortgage scenario 1 or mortgage scenario 20 year. Basically like a "save as" and an "open" button.
I reported back that this approach isn't really feasible and a server database or some other form of server persistence is the norm.
Am I way off base in being insistent that we need to use a database? Or are there any options I'm not aware of such as jquery?
How about object serialization? If you use PHP as backend, you could gather form data to array, serialize it and output to downloadable file.
Another attempt is to catch form data into JSON using only JS, and then making user save it. Look here for more info: How to generate and prompt to save a file from content in the client browser?

Internal web page to retrieve, save and store information?

(I apologize for any incorrect lingo)
I am creating an internal web page as a sort of intranet for me and another associate to use in our department to keep track of information. I have created "pages" using HTML to navigate and saved in our department folder. Doesn't need to be flashy just functional.
I have a table with 5 columns of information for each item we need filled out. I have created a pop-up window and form for these 5 columns to open and the idea is that when the the user (me) fills the form out and clicks the submit button, the information is transferred to the parent page, saved and stored for later tracking.
I'm assuming this isn't possible by just saving .html files into our network folders. I think i might need a database to "save" the information the user filled out.
I wouldn't necessarily need the window pop-up..
Is this way over my head?
You would at least need a server side language such as PHP. Using a Database is highly recommended.
In my very humble opinion - Yes, it does sound as if this is over your head right now.
Recommended readings:
http://www.amazon.com/s/ref=nb_sb_ss_c_0_3?url=search-alias%3Dstripbooks&field-keywords=php&sprefix=php%2Caps%2C129
Let me know if my answer is helpful.

Is it possible to collect data from one page and autofill it onto a form on a different site using JS/jQuery?

A site I am working on requires user information to be collected from a form when the user presses the submit button. The site will then take the information and plug it into a more robust form on a different page, so the user does not have to retype the information twice.
Is this possible using javascript?
Any help appreciated.
Once the user leaves the current page, the JavaScript on the original page is no longer running, They will load up the other page and run that page's JavaScript.
Do you have ownership of both pages?
If so, then you can leverage the form GET to pass information across pages, so the next page will have a Query string, and JavaScript can parse that.
Another way to move data from one page to another is to use Cookies. So it really depends on how much data you want to move around.
But I highly recommend that you leverage the server-side technology to handle the form GET or POST and carry information across pages.
This completely depends on the OTHER site. You can have a form with the same field names and post it to the same URL the other site's form uses.
BUT - if that site checks to see where the original post came from, it may block you out.

Categories