Pre submission form - javascript

I am new to web-building, I am interested in creating a pre-submission form for new users to a gallery / forum for a ghost group. Log their inputs when successful.
What I am trying to achieve is.
When a new user comes to the the landing page, they are asked for their
Username
Age
Referring site code
When they will submit the information, it will check if the username already exists; if they are over 18 and the website code that referred them to the gallery/forum.
I trying to have a members only forum gallery for my ghost group and their friends that are serious. Not to the open public.
I want to have a pre form so that if the general searcher stumbles on the page thay cannnot try to access it.

try looking at some frameworks such as stripes or struts
which will allow you to have form data posted to servlets and having the framework(and/or servlet) perform validation e.g lookig up to see if a record exists, number > 18 etc.

Related

How do I get a value from html and post it?

im a begginer web developer and i want to make something like that:
you login with username end password, then it redirects you to the home page, and says something like this:
Hello (username) welcome!
but i dont know how to read the value from the input please help
i searched it up but it only showed a search input option
This is too generalized for such a question. Many questions: -Are you using any backend? If so which one (what language? And what kind of database (ie SQL etc.))?
To store data you need a backend or at least use frontend js's localStore (would work if every page is on the same domain and server).
Yet another front-end way would be to pass the information as url-parameters and get them.
But if you really want to build a robust login system of any kind, the best way is to use backend (PHP/node JS/Java/python etc.) and store the data in a database (SQL etc.). And make sure it is secure, but security is too broad of a topic for this question.
Your asked very generalized question, for my assumption there you want to do either one of these
when you login, you want to keep username from input and and redirect the user to home page and show the username on the label like hello abcd
You have an input field with username on home page and want to show the text of the input field into label
so, I will give answer considering the above scenarios, the answer will be considering how I will do things(as I don't know what you are using in backend the answer may vary)
for point 1 I will store the username in a localstorage, sessionstorage or cookie.
let's say I used sessionstorage, the below code will be performed on my login button click
sessionStorage.setItem('quantity',document.getElementById('username').value);
and on my pageLoad of home page I will set the value in my label like below
document.getElementById('lblusername').text = sessionStorage.getItem('quantity');
option 2,
on my home Page I will simply get the value from input field and show it on label
document.getElementById('lblusername').text = document.getElementById('username').value;
let me know if it helped you as I don't know your exact scenario

What's the Flow for Stripe Elements?

I'm switching from PayPal to Stripe so I can keep the checkout system entirely on my own sales site. While I have an intermediate understanding of PHP and API interactions, I'm so jaded from using PayPal for 3 years I can't figure out how the flow works for Stripe. Their documentation is excellent, it's more "Dictionary" like and not actual examples.
I'm looking to sell Subscription payments from my own site. You create the HTML, include the Stripe.js bit, but what's the process itself? As in, "index.php submits the checkout form, which notifies Stripe, which sends a ping back to charge.php..." etc, that sort of thing.
Where does the customer creation go, and how does it get attached to a CC charge?
Where does the confirmation from Stripe go?
Where does my price checking PHP go?
I've emailed Stripe, and while they're friendly enough they more or less just told me to go online to their documentation, which I've already spent hours in and still don't get it.
I know I'm being dumb - the tutorials online all seem to focus on Stripe Checkout, which is the popup that I don't want, not the custom HTML form.
Thanks in advance guys. :)
There are a number of different ways you can set it up. Here's how we do it in our application.
When the user enters CC information, you use the Stripe.js API on the client to submit the CC to Stripe, and it returns a token. The callback removes the CC data from your form, puts the token in a hidden field in the form, and submits the form to the server.
If you want to save the customer's CC information so they don't have to re-enter it every time, you then use the stripe-php API to create a \Stripe\Customer object for this CC, sending the token as the card parameter. This will return a customer ID, you can save this in your user database for future reuse.
To charge the card, you create a \Stripe\Charge object, with this customer ID in the customer field. The response from this indicates that the charge was successful; if there's a problem it will throw an exception.
If you just want to do a one-time charge without saving the CC permanently, you could just go straight to creating the \Stripe\Charge object, and use the token as the source field.
If you want to allow customers to have multiple saved cards, you create the \Stripe\Customer object the first time, and when they add a new card you retrieve their customer object, add the new token to the source array, and update it. Then on future charges you can specify both the customer and source fields. In this case, the source field should be the card ID of one of their saved cards.
You would presumably do your own validation of the form, and calculate the price, before calling the Stripe API from the PHP script.
Stripe do have a section with examples and sort of step by step guides for this, don't know if you found it - its separate to the API documentation and I didn't see it first time round. [https://stripe.com/docs/subscriptions/quickstart][1] [1]: https://stripe.com/docs/subscriptions/quickstart
For this to make sense, you will need to install their client library for PHP (or whatever you're using) and be familiar with PHP forms.
To answer your questions:
Where does the customer creation go, and how does it get attached to a
CC charge?
This is done using the functions from their library, see link above. The customer creation is sort of separate from the charge. You will need to store the customer ID in your database to charge them later.
Where does the confirmation from Stripe go?
This is returned in the response from the api call.
Where does my price checking PHP go?
Not sure what you mean by this. Presumably you work out the price to charge them first with your code, you can then just give this to stripe as an amount.
Hope this helps.

How to pass data to a field in Google forms

Question: Is there any way to pass the data from my site to one field in Google Forms?
Example:
I have a web-page where logged user1 is able to interact with other user2. At the end of interaction I want to know the opinion of the user1 about user2.
I want to use Google forms for that. Creating a form with few questions and embedding it on my site is an easy one but I am trying to figure out how to create a field in "Google Form" that will fetch name of user2 from my site/database so I user1 does not have to type it again and again.
Google forms already have such functionality. Follow the steps to create a form and pre-fill any field and/or fields..
Go to Google Drive and Create New Form
Add all the required fields
Click Responses and select Get pre-filled URL
Fill the Values you want to be Pre-filled (At this time the values you enter doesn't matter! You will be able to change it through URL you will get in the next step)
Hit the Submit button! And you will be prompted with the URL
Just Paste the URL in the textEditor and as you can see URL has the values you entered! Just replace them with desired values or generate from the Database your choice!
And you are done! :)
For more help you can visit this link

Hiding an dynamic e-mailadress in an dynamic hyperlink

First time question here and a prog-newbie aswell so i will try to be as clear as possible with my question.
I have Sharepoint 2010 Online and i've been trying to found out a way to connect some site to a third-part-ticket website.
My company have different customers and these customers have a specific customer-site in Sharepoint, aswell as a specific contact person who should be contacted when a ticket is raised.
What i do have at the moment is this;
Specific Customersites in Sharepoint(so the URL for Customer y is like CustomerY.aspx and for Customer X CustomerX.aspx).
I also have a third party web-site with the ticketsystem. The first part of this url is static, whereas the second part is based on what customer is trying to reach that ticketsystem.
I also have a specific contactperson for the specific customers.
Would it be possible(with javascript) to in an hyperlink, link to the customer's specific ticket-system website and at the same time send an e-mail to the choosen contact-person?-
I hope i have made my self as clear as possible.:)
If you have any further questions, please ask.
No, it is not possible. You cannot send an e-mail by executing javascript in the browser.

How to create the automatic mass form submitter script to be used on the 3rd part websites, where I know their fields names-values?

I need a script that can handle the following tasks.
Take user data from my database and fill in and submit / post data to forms
located on third part websites.:
So I want to know if is it hard to create or do somebody knows if does exists some script for mass form submissions in PHP -Javascript-Ajax ?
I run Dancers & Hostess & Model jobs website, I would like to find some script which allows the girls automaticly submit to hundreds websites forms (other 3rd part model agencies) with their similar model application form info on my website previously specified,
1).Firstly the girls will fill out my
agency portfolio very detailed form ,
like this i will get all the model personal info
from them ,
2) Secondly i would like to allow
for example models to submit to
100 and more other model agencies
forms (I will find those websites before, and I
will get their field names = values
and thanks to some script would like
to connect them with every girl data
already created in my website to
submit .
I would like to implement it to my wordpress website where the girls has their portfolios instead of my pages .
I would like to offer this service especially to models , it should work like some directory submitters , The script knows names - values and fill it out itself, but I want it online - browser side, where the girls should only fill out captcha if there is and click the button "submit".After succesful submit it should offer other form to submit.
I would be very happy if you know the answer or if you can redirect me to some article
example website :[SEMI AUTOMATED LINK DIRECTORY][1]
[1]: http://www.onewaytextlink.com/links.php?type=free&pagenum=1"SEMI AUTOMATED LINK DIRECTORY"
Sorry, but it ain't gonna work. Cross-domain ajax is forbidden. Although you can avoid this restriction more or less by various techniques, many sites won't accept cross-site requests due to security reasons.

Categories

Resources