This topic is locked

Remove "Please Select" from Lookup wizard

9/8/2010 1:22:21 AM
ASPRunnerPro General questions
W
Wheelers_Hill author

We've several drop down lists (or lookups) for which we'd like to remove the defeault "Please Select" value and only show the values we've added.
The site in question is regnerated or built almost weekly so would prefer a solution that does not require me to edit the output files or common functions each time we do a build.
How can we do this??

S
Scruffy 9/8/2010



We've several drop down lists (or lookups) for which we'd like to remove the defeault "Please Select" value and only show the values we've added.
The site in question is regnerated or built almost weekly so would prefer a solution that does not require me to edit the output files or common functions each time we do a build.
How can we do this??


I think it's the line in commonfunction.asp



if IsLess(lookupSize,2) then
ResponseWrite ("<option value="""">" & CSmartStr("Please select")) & "</option>"
else


Remove the responsewrite bit, make commonfunction.asp file readonly on your server, this way when you make changes it wont be overwritten.



if IsLess(lookupSize,2) then
else
Sergey Kornilov admin 9/8/2010

To make this change permanent modify C:\Program files\ASPRunnerPro6.2\source\include\commonfunctions.asp file.

M
mows 9/16/2010

I've tried to resolve this issue by modifying C:\Program files\ASPRunnerPro6.2\source\include\commonfunctions.asp file.
Within that file there are 3 lines of code which have the code:

response.Write "<option value="""">" & ##message PLEASE_SELECT## & "</option>"
I've commented out each of them and this has given the result I was after in that Please Select no longer appears in Add and Edit screens.
But this has also rendered the Advanced Search useless as now all drop down boxes in the Advanced Search show a value.
I've tried reinstating the three lines of code one at a time but have not been able to determin which particular line effects the advanced search and which the add and edit screen. Replacing just one of the three lines made Please Select appear in both edit screens and advanced search.
What I need is a solution to this original issue which does not break advanced search

S
Scruffy 9/17/2010

Then don't use lookups on your advanced search page, leave it as a free text box.

M
mows 9/19/2010



Then don't use lookups on your advanced search page, leave it as a free text box.


Got excited about this solution but unfortunately it does not work.
We require lookips in the list page. We've setup inline editing.
Have tried within the Visual Editor to change the control to be a free text box but doing this also changes the control within the List page.
Sergey are you able to offer a solution?

Sergey Kornilov admin 9/20/2010

Mows,
by default all fields use the same 'Edit as' format on all Edit/Add/Search pages.
I would suggest to create field alias in SQL query and setup a different 'Edit as' type for this field.

select

field1,

field1 as newfield1

from ...



Make sure newfield1 appears on Advanced Search page only. Set 'Edit as' type to anything you need.