cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
331
Views
0
Helpful
3
Replies

empty Input IPPhone problem

robinboer
Level 1
Level 1

I would like to say that my service runs fine in the emulator but not on the IPPhone (7960).

I've got a input page and would like to use these inputs in another page.

After all inputs a "*" must be placed.

All works fine, but when I enter nothing the IPPhone comes up with "undefined*" as a Var.

I've tried to work around it but with no succes.

Please advice.

Thanks,

Robin

--------------------Code-----------------

<%@ Language=JavaScript %>

<%

var fStr=Request.QueryString("fStr")+"*";

var lStr=Request.QueryString("lStr")+"*";

Response.ContentType = "text/xml";

try

{

var s = new ActiveXObject("LDAPSEARCH.LDAPSearchList");

s.server = "XXXXXXXXXXX";

s.AuthName = "cn=Administrator,CN=Users,DC=VOIPTest, DC=com";

s.AuthPasswd = "XXXXX";

s.searchbase = "dc=VOIPTest,dc=com"; //ou=Holland

s.SetOutputTitle("Phone List", 45);

//s.SetOutputPrompt("Records %s to %e of total %c", 45);

s.SetOutputPrompt(lStr + " " + fStr , 45);

//s.SetSearchOption(10,0);

s.AddReturnAttr("givenName,sn","Name","%1,%2", 30);

s.AddReturnAttr("telephonenumber","Telephone","%1", 30);

s.AddSortingAttr("telephonenumber", 1);

Response.Write(s.XMLOutput(1, 32));

}

catch(err)

{

Response.Write("Error: " + err.description);

}

Response.End();

Session.Abandon();

%>

1 Accepted Solution

Accepted Solutions

Actually, it's not a workaround, it's the proper thing to do. JavaScript returns undefined if a variable has not been defined, Java returns null. My own Java LDAP searcher thus sets the search string to * if the query string I'm looking for has not been defined.

What is your problem with s?

View solution in original post

3 Replies 3

robinboer
Level 1
Level 1

Found a work around:

-----------code---------------

if(fStr == "undefined")

{

fStr="*";

}

else

{

fStr= fStr+"*";

}

-----------code---------------

Still strange :s

Actually, it's not a workaround, it's the proper thing to do. JavaScript returns undefined if a variable has not been defined, Java returns null. My own Java LDAP searcher thus sets the search string to * if the query string I'm looking for has not been defined.

What is your problem with s?

Ok this is the first time i work with JavaScript.

I've worked with quite a few languages but never encounterd this before. (Never to old to learn :) )

the "s" is a smily thingy

I use it when i think something is strange.

just like :P or ;).