This topic is locked

Field size

9/7/2005 5:11:09 AM
ASPRunnerPro General questions
author

Hei

How can I change the size of a text field after I have made the files. this is the code asprunner have been writing
<%

sFieldName = "Long_description"

if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
Response.Write "<td>"
nType = rs.Fields(sFieldName).Type

bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
strEncoded = HTMLEncode(strValue)
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = HTMLEncode(GetDefaultValue(sFieldName))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if

%>
Hope you can help me.
Rgds
Axel

Sergey Kornilov admin 9/7/2005

Hi,
you can modify GetEditParamsfunction in generated \include\..._aspfunctions.asp file.

Set the size you need in this piece: GetEditParams= " size=XX "

501245 9/7/2005

Thanks for it it works. Can I also make it to be 2 rows the same way.
Rgds
Axel

Sergey Kornilov admin 9/7/2005

Axel,
modify function GetEditFormat(strField) in generated \include\..._aspfunctions.asp file

function GetEditFormat(strField)

GetEditFormat = FORMAT_NONE

if strField="YourFieldNameHere" then GetEditFormat = "Text area" end if

...

A
axelm 9/8/2005

When I change ti to area aI can not control the lengt of the area is it possible to do that it seems to me that it is in the javascript.
Rgds
Axel

Sergey Kornilov admin 9/11/2005

ASPRunner do not control text size you enter into text area. I guess this can be done using some Javascript.
Here is the script that does the job:

http://javascript.internet.com/forms/limit...t-textarea.html

501246 9/12/2005

Thanks for that
Rgds

Axel