Topic awaiting preservation: variables in URL from form |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: everywhere |
posted 04-23-2003 13:56
Say I have a form (which thinking about it, I do), which you fill in, then you click one button to email it to me (all already done through php) and another button to sign my guestbook. The way I've done the second is to open a new window with the URL of the guestbook CGI, with the values in the form appended to the URL via JavaScript (can't remember if this is POST or GET). Trouble is, one of the form elements is a multi-line textarea, and forced line breaks don't convert into the URL. Is there some special character I can use, and how do I replace the line breaks with it using JavaScript? |
Maniac (V) Inmate From: Brisbane, Australia |
posted 04-23-2003 16:58
Ok, this is more of a server side problem. |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 04-23-2003 17:15
quisja: I wouldn't pass the contents of a textarea via a URL (GET by the way ). There is a limit to the size of the URL and it just gets messy. I'd recommend you use POST instead. |
Paranoid (IV) Inmate From: everywhere |
posted 04-23-2003 19:07
Drac: I think you misunderstood slightly, I wasn't actually submiting a form, I just used Javascript to make a string (URL/?this=blah&that=blah) which I then opened in a new window. The page I am submitting to isn't something I can modify, so I don't want to mess about making a php script which it will all have to go through. I wasn't sure if this was a good way at the time. So is there a way for a form to have two submit buttons, which change it's action property depending on what you want it to submit to? |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 04-23-2003 19:13
sure. you could do something like this |