+ 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)