Submit form question |
Submit form question |
crusty |
Mar 21 2012, 01:42 PM
Post
#1
|
Group: Members Posts: 4 Joined: 21-March 12 Member No.: 16,758 |
I am trying to build a form where you input a value and when you hit [Submit] it attaches that value to the end of a URL and targets it into a lower frame. I know how to make framesets and I know how to target specific frames.
For example: If you input "577095475" (without the quotes) then hit submit it attaches the numbers to "http://facebook.com/profile.php?id=" (again, without the quotes) and "http://facebook.com/profile.php?id=577095475" shows up in the lower frame or a new tab / window. Is this possible? Thanks in advance! -Josh |
pandy |
Mar 21 2012, 02:21 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
It depends on what method you use (as in the method attribute for FORM). When GET is used, the form data is sent as a query string in the URL, what you want.
Read about it here: http://htmlhelp.com/reference/html40/forms/form.html . |
Christian J |
Mar 21 2012, 02:25 PM
Post
#3
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
"http://facebook.com/profile.php?id=577095475" shows up in the lower frame or a new tab / window. The textfield should have the NAME "id", and the form's TARGET should be the name of the lower frame (or "_blank" to open a new window). The form's ACTION should be "http://facebook.com/profile.php". |
crusty |
Mar 21 2012, 02:25 PM
Post
#4
|
Group: Members Posts: 4 Joined: 21-March 12 Member No.: 16,758 |
ok... sorry to waste anybody's time but I got it using:
CODE <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Untitled</title> <script> function convertURL() { var url = document.getElementsByName( "url")[0]; var fullurl = document.getElementsByName( "fullurl")[0]; fullurl.value = "http://facebook.com/profile.php?id="+ url.value +""; } </script> </head> <body> <!-- do not name objects reserved words: search, submit, reset, etc. --> <form name= "Search" onsubmit='convertURL();location.href=fullurl.value;return false'> <p> <input name='url' type='text' size="20" /> <input name='fullurl' type='hidden' /> <input name="submitTwo" id="submitTwo" type="submit" value="Search"> </form> </body> </html> so far it works great but I can't figure out how to target a specific frame. Any suggestions? Again, thanks in advance! -Josh |
Christian J |
Mar 21 2012, 02:28 PM
Post
#5
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
|
crusty |
Mar 21 2012, 02:33 PM
Post
#6
|
Group: Members Posts: 4 Joined: 21-March 12 Member No.: 16,758 |
|
crusty |
Mar 21 2012, 02:40 PM
Post
#7
|
Group: Members Posts: 4 Joined: 21-March 12 Member No.: 16,758 |
I got it... thanks for the help!!
I really do appreciate it!! this is what I did: CODE <form action="http://facebook.com/profile.php" method="get" target="new"> <input type="text" name="id"/> <input type="submit" value="Search"/> </form> Thanks again!! Awesome help! -Josh |
Christian J |
Mar 21 2012, 03:55 PM
Post
#8
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
You're welcome! Hm, is "new" the name of your frame? If you just want to open a new window, there's a difference between the keyword "_blank" and names such as "new", "foo", etc: http://thedesignspace.net/MT2archives/000316.html
|
Lo-Fi Version | Time is now: 25th April 2024 - 01:25 AM |