This looks like Javascript so I will post a trim function someone posted for me
a while back and I hope it helps:
function trim(StringToTrim){
var strReturn = new String(StringToTrim);
while (strReturn.charAt(0) == " "){
strReturn = strReturn.substr(1, strReturn.length - 2);
}
while (strReturn.charAt(strReturn.length - 1) == " "){
strReturn = strReturn.substr(0, strReturn.length - 1);
}
return strReturn;
}
Mark
arnnie2005 <[EMAIL PROTECTED]> wrote:
How can I remove the leading spaces in a variable within an a ASP page?
This is what I'm trying to do. I have a dropdown from which a suer
will make a selection. Then I am comparing the selected value another
hardcoded value. like this:
if (document.form1.cmbCenter.value=="" &&
document.form1.cmbDivision.value == "Clinical Services")
{
do something.
}
But it seems to me that the document.form1.cmbDivision.value lenght is
longer than "Clinical Services". That is why I want to eliminate any
leading spaces to document.form1.cmbDivision.value .
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [email protected]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
SPONSORED LINKS
Active server page web hosting Active server page hosting Active server pages
Active server page asp Active server page training
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "active-server-pages" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/17folB/TM
--------------------------------------------------------------------~->
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [email protected]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/active-server-pages/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/