Update data on the form / tokens - javascript

What I wnat to build : (first I must say that I havent got any accounts on my web site) For example I have form with input field that every one can fills, after that you can submit form and if everything correct you will forwarded to another page !THAT CONTAINS! url for your filed form (previous page with form that you filled)
Easy explaine : You fills form then click submit button if all OK go to another page that contains button with url to your filed form (for example if you want to fix some data on it)
PROBLEM : How to build this, if I havent got users with their own form.
I have heard about tokens but never worked with them. What can I do ?
Can someone help me ? Forward me to the right way

Related

Pass multiple Field Values and submit through HTML Link

There is a website that I do not have access to on the back-end that I go to monthly, type in my email address, check a few boxes and hit a submit button.
A while ago I found out You can append
?fieldname=value
to the end of the url to have it automatically fill that value into the field with that name. But is there anyway I can expand on this and fill in multiple values and hit the submit button?
Thanks!
Adding ?fieldname1=fieldvalue1&fieldname2=fieldvalue2 etc.. can add many more parameters send to the server.
Some website use those parameters in the page so when you add the good parameters, you will get the page with the modifications that those parameters did on it.

submit button with no form filling

Hi i want a button to be shown on all my pages.
that code should be in such a way that no form filling is needed
the text on button will be "Problem? Click Here"
when click on button, it will be pressed and the person who has clicked cannot click again unless reload the page.
After the button is clicked the mail should be sent to admin with the exact link of page where button was clicked.
there should be no form to fill.
As for example facebook like button like the content meanwhile its pressed.
What should be the code for this? Any suggestion please?
Thank you
You can use an HTML button element with an onclick javascript function linked to it.
Since you don't want the button to work again until you have reloaded the page, you will need to do this through AJAX. This means you will have to send a request to the server, where, for instance, a PHP script will retrieve the page name from a GET variable and send the email to the administrator. The javascript part can keep track of the button being clicked once or not.
That should give you some pointers on where to start with your code. However, as stated in direct comments to your question, this site is not meant for asking for coding work to be done for you. Perhaps next time, try to think of a possible solution and ask for advice on your solution (improvements, coding conventions, etc)

Access Form Action of another server through javascript

I have a simple html form which contain 2 fields and submit button. After hitting submit button my data transfer toward the another server through query string named "http://www.123contactform.com" which is load in iframe on my page and the field which is in the iframe become pre-populated with the information coming from query string. That's All I have done.
Now what I want want when the submit button of iframe click, the page transfer towards the another page, I want to restrict that navigation and define my own url with javascript.
Can any one help me, How do I get this???
Regards,
Ammar
Can you show some code ?
And
Logically What you want is something like this - You have an iframe on example.com and that iframe load's gmail's login page, You want to change the submit url of gmail's login form ?
NOT POSSIBLE

Get form field value after going back in browser?

I have a contact form with a similar setup to the "Ask a question" form here on Stackoverflow, a user will click a suggested link that will take them away from the contact page, on the new page they get to there is a link back to the contact page via:
Back
When the user returns to the page the previously entered values (e.g. name, email, question, message) are filled in correctly. How can I access those values from JavaScript? (using jQuery)
element.val();
^ Returns nothing as technically as far as firebug tells me there's no value actually entered. The browser is somehow filling the fields. I only need to access one text field in this case.
I think you can solve this with jquery session. https://github.com/AlexChittock/JQuery-Session-Plugin

Switch to POST from GET, need to submit a form to two different locations

[I did see the similar problems solved with AJAX/jQuery, so please read on].
I have a form that a user can fill out - but one of the options on the form allows selection of an image, and when the user goes to do that they are brought to a new page.
This was originally done via get, but my problem is... I need to save all of the information on the form to the session so that I can restore it when the user selects an image and goes back to the first page that had the form.
A HTTP GET may not hold enough data for all the information on my form, so I need to switch to post.
So, here's my problem... I need the form to POST to one page when I click "Select Image" and another when I click "Submit". How can I get the form to POST to a different page depending on which button was clicked?
PS: I'd prefer to just use standard javascript/html here. I plan on learning AJAX and moving over to jQuery after a while, but I'm not there yet :)
onclick, let each button call different functions. Within these functions, change the action attribute of the form dynamically.
document.forms['yourform'].action = 'your intended page';
Then submit the form.
document.forms['yourform'].submit();

Categories