I have a page that has some text boxes on it, with a description of the text box next to it. Some of those descriptions are hyperlinks, based on certain conditions. When the user clicks on one of the hyperlinks, a popup window comes up, and users can enter more detailed data, regarding that text box. Here is the function;
function NewWindow(URL, varwidth, varheight)
{
var width=varwidth, height=varheight;
//detailsWindow = window.open(URL,'none','width='+width+',height='+height+'');
detailsWindow = window.open(URL,'none','width='+width+',height='+height+',top=0,left=0,scrollbars=yes');
return false;
}
When the user clicks on the link, and the function fires, I bring all the values from the other text boxes into hidden form fields, because when the user updates the information in the popup window, the information they just entered, as well as the information in the other text boxes is saved in our database.
The problem I am running into is with these three comments boxes on the page. Whenever a user enters a "%" sign, the character is stripped out, so "96%" is saved as "96". If a user enters a "#" sign, it only takes what is to the left of the "#" sign. The rest of the text boxes are numeric fields. How can I, using the above function, replace anywhere a "#" or "%" sign is used, to it's ascii equivilant?
Oh, and by the way, the way I put the text box values into the hyperlink is "form.fieldname.value", so I'd use something like this:
NewWindow('pagename.asp?name='+form.name.value+'')
If users do not enter # or %, then I'm fine, but I need to be able to handle these characters. Thanks for any help.
function NewWindow(URL, varwidth, varheight)
{
var width=varwidth, height=varheight;
//detailsWindow = window.open(URL,'none','width='+width+',height='+height+'');
detailsWindow = window.open(URL,'none','width='+width+',height='+height+',top=0,left=0,scrollbars=yes');
return false;
}
When the user clicks on the link, and the function fires, I bring all the values from the other text boxes into hidden form fields, because when the user updates the information in the popup window, the information they just entered, as well as the information in the other text boxes is saved in our database.
The problem I am running into is with these three comments boxes on the page. Whenever a user enters a "%" sign, the character is stripped out, so "96%" is saved as "96". If a user enters a "#" sign, it only takes what is to the left of the "#" sign. The rest of the text boxes are numeric fields. How can I, using the above function, replace anywhere a "#" or "%" sign is used, to it's ascii equivilant?
Oh, and by the way, the way I put the text box values into the hyperlink is "form.fieldname.value", so I'd use something like this:
NewWindow('pagename.asp?name='+form.name.value+'')
If users do not enter # or %, then I'm fine, but I need to be able to handle these characters. Thanks for any help.