ober0330
May 12th, 2004, 08:26 AM
Ok, so I have the following function:function gofull()
{
URL = location.href
if (URL.search("Date_Found") != -1)
{
URL = URL.substring(0,URL.search("Date_Found")-1)
}
URL=URL+"?Date_Found="+document.dform.Date_Found.value+"&Last_Known="+document.dform.Last_Known.value
if (document.dform.TagNum.options[document.dform.TagNum.selectedIndex].value != 1)
URL = URL+"&TagNum="+document.dform.TagNum.options[document.dform.TagNum.selectedIndex].value
if (document.dform.SYMP.value != "")
URL = URL+"&SYMP="+document.dform.SYMP.value
if (document.dform.User.options[document.dform.User.selectedIndex].value != 1)
URL = URL+"&user="+document.dform.User.options[document.dform.User.selectedIndex].value
if (document.dform.impact.value != "")
URL = URL+"&impact="+document.dform.impact.value
URL = URL+"&act_prod_date="+document.dform.act_prod_date.value
location.href = URL
}
-->
</script> It works great except for the fact that the "SYMP" field is a string that will contain spaces. When that field is put into the URL when the form is refreshed, it adds "%20" for each space... and then when I use the following: <?php
if(isset($_GET['SYMP']))
echo "<input type=text name=SYMP size=40 value=" . $_GET['SYMP'] . ">";
else
echo "<input type=text name=SYMP size=40 value=\"\">";
?> it only puts the first word of the string into the textbox.
How do I get it to grab the whole string out of the URL?
{
URL = location.href
if (URL.search("Date_Found") != -1)
{
URL = URL.substring(0,URL.search("Date_Found")-1)
}
URL=URL+"?Date_Found="+document.dform.Date_Found.value+"&Last_Known="+document.dform.Last_Known.value
if (document.dform.TagNum.options[document.dform.TagNum.selectedIndex].value != 1)
URL = URL+"&TagNum="+document.dform.TagNum.options[document.dform.TagNum.selectedIndex].value
if (document.dform.SYMP.value != "")
URL = URL+"&SYMP="+document.dform.SYMP.value
if (document.dform.User.options[document.dform.User.selectedIndex].value != 1)
URL = URL+"&user="+document.dform.User.options[document.dform.User.selectedIndex].value
if (document.dform.impact.value != "")
URL = URL+"&impact="+document.dform.impact.value
URL = URL+"&act_prod_date="+document.dform.act_prod_date.value
location.href = URL
}
-->
</script> It works great except for the fact that the "SYMP" field is a string that will contain spaces. When that field is put into the URL when the form is refreshed, it adds "%20" for each space... and then when I use the following: <?php
if(isset($_GET['SYMP']))
echo "<input type=text name=SYMP size=40 value=" . $_GET['SYMP'] . ">";
else
echo "<input type=text name=SYMP size=40 value=\"\">";
?> it only puts the first word of the string into the textbox.
How do I get it to grab the whole string out of the URL?