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

31st Jan 2018, 6:06 PM
SeeGreatness
SeeGreatness - avatar
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
31st Jan 2018, 11:51 PM
Toni Isotalo
Toni Isotalo - avatar
+ 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)
1st Feb 2018, 2:48 AM
SeeGreatness
SeeGreatness - avatar