Find the address where a user entered this page in angular 8 - javascript

i need to know user Find the address where a user entered this page in angular 8 .
for example : this user enter this page from forgetpassword or enter this page from activationCode i must show difrent form for user .
how can i do this ??

I did not quite understand, but from what I could understand you would like to redirect the user to different views depending on if they used /forgetpassword or /activationCode?
If so, just define the routes in your app.router.ts file with the respective components for the front-end view.

Related

Support refresh on user edit form

I am wondering do I need to support the feature to refresh user form (share the link for it) while editing a user?
The scenario:
1. Admin clicks on edit user;
2. Filled User form loads on URL my-domain.com/user/edit/3;
3. Admin refresh the page;
4. The form loads again with fields filled;
Do I need to support this feature (Admin refresh the page and user data is still there)? Is this an unnecessarily extra?
Example scenario if I do not support this feature:
1. Admin clicks on edit user;
2. Filled User form loads on URL my-domain.com/user/edit;
3. Admin refreshes the page;
4. Admin being redirected back to users list;
I am using React and the question more specific would look like this:
Do the form component need to receive the user in props OR the user form have to load the user from the server itself by URL parameter (userId)?
I would say it's not neccesary.
Do I need to support this feature (Admin refresh the page and user data is still there)? Is this an unnecessarily extra?
Generally when I refresh the page its because I dont want to erase every field.. or the form doesnt have 'reset' button.

How to keep search query in a sharable URL

(Web dev newbie here)
I have created a simple one page React App that has an input form and, after a button click, calls an API and displays the response.
I would like to be able to share an URL that would take people directly to the app and would search automatically.
For instance, a user goes to the app (http://myapp.com/) and inputs sophie and 20. He then gets information about that person (a fetch is made with this input) - this is already working. But also, the url changes to something like this:
http://myapp.com/person?name=sophie&age=20
The user would now be able to share this URL and people would be redirected to the app which would show data about sophie, after calling the api with sophie and 20 as input again (without the user having to input anything).
What is the best way for doing this?

How Do I Create An Email Event With Javascript

Basically i'm creating a website for a friend and he needs a "Contact Us Page", i'm using bootstrap studio and I have a page where you enter your name, and email. But i'm having trouble with the next part. I need the page to open the client's default email program to compose to a certain address with the entered name and email already in it how would one go about this?
simply do something like this
Click Here To Email!
if you want the email to be sent via a form submission you either need to setup a backend that will do that or you can use a service like https://formspree.io/
I've used them before, but I'm not certain what they're rules are about data privacy so its really up to you.

How to Handle Forms present in the Single HTML Page

My Doubt is as follows I have a static HTML Page(Login.html) with 3 forms in it namely
Login Form
Create Account Form
Forgot Password Form
When the user Types in my correct user email Id an password in the LOGIN Form, the form needs to direct it to a different HTML page namely dashboard.html. When the user Selects forgot Password form, the form will ask the user to enter his email ID and once the user clicks on Submit button the forgot Password Form should redirect it to Login Form in the Login.html file. Both the Forms are in the Single Html Page.
My Question is that How do I redirect from One form to another form in a Single HTML page using Angular JS and Also from one page to another page in Angular JS. I couldn't Find good tutorials on this Issue. So can somebody help me with this issue.
If you need to redirect between forms in a single-page html application, you will need to use routing. Your choices are ngRoute which is a part of AngularJS but a separate module, and ui-router from the AngularUI folks, which I would recommend.
I assume you are handling your login form submission using the ngSubmit directive on the form? If so, check the username/password by whatever means you need to in the scope function assigned to ngSubmit. If the credentials are valid, use the router or the $location service to redirect the user to the dashboard. The link to the forgot password page is a simple link with an ngHref or ui-href, depending on the router you are using.
Your HTML pages will be displayed in the section of the page set aside for views (again, check which router you are using). The HTML pages should be partial pages, not full HTML pages, since they are going to be inserted in the main page of your single page application.
Hope that helps.

Sharepoint: access subsite page contact from workflow

I'm trying to create a work flow that will send an email to the users in the contact field for the page that the initial link was followed from.
In other words, a user clicks a link on page ../top/sub/pages/page1.aspx which takes them to a form here: ..top/lists/feedback/newform.aspx. Once they submit the form on the top level page it starts a workflow (at ..top/lists/feedback/) which will email the users in the meta data for the referrer page (../top/sub/pages/page1.aspx) and finish by deleting the feedback item.
My problem lies in trying to email the correct user. I have tried to make a work-flow on the sub-site, but it seems like the work-flow has ZERO access outside of its directory.
My next idea would be to try and send the user as a parameter (as part of the form) using a script, but I'm unsure of how to access the information I need.
How would I access the page's contact user? Am I even on the right track?
ps. I dont have access to the server and therefore am unable to use visual studio
Probably there might be some dirty workaround.
add a hidden field to you top/lists/feedback/
add a delegate control that stores the contact on the page the user came from i.e. in the user session (or somewhere in SharePoint or in DB) and place the control on the pages ../top/sub/pages/ (or place it everywhere but make it work only on the pages)
add an itemeventreceiver in the list ..top/lists/feedback/ that grabs what the delegate control saved and inserts it into the hidden field in the item that is created in the ..top/lists/feedback/newform.aspx
use the hidden field in the wotkflow.
I hope you can either accept it or generate you own idea reading my answer.
Good luck!

Categories