+ 1
fourm data to variables
How would I go about putting data (strings) in the url and then going to that url after a user has entered data into a fourm? My idea is a fourm that only has a subject, a message box and a submit button that after pressing will take the user to a url that is subject+message with underscores instead of spaces. All i really need help with is directing the information from the fourm into variables from a html page the rest I can do by hand.
2 Answers
+ 1
function click() {
var sub = getElementById(āsubjectā).val;
var msg = getElementById(āmessageā).val
sub = sub.split(ā ā).join(ā_ā);
msg = msg.split(ā ā).join(ā_ā);
window.location.href(ānew urlā);
}
I didnāt understand what kind of url you wanted but thereās subject and message in their own variables with underscores instead of spaces. And the redirect function
+ 1
@Toni Isotalo Here is my code https://code.sololearn.com/W15ZFBWuL37c/?ref=app I do not know what is wrong but I have a better explanation of what Iām trying to do (itās all for this app I got for notifications) and I donāt actually need underscores for spaces I could use the url scheme for a space without using a space (I think that would work Iām actually not sure)