This topic is locked

Accessing values on Edit page

8/4/2010 3:06:39 PM
ASPRunnerPro General questions
T
tone21705 author

Hi,
On my Edit page I would like to be able to access the values in an ASP code snippet so I can make a hyperlink next to the form object.

For example:

  1. TextBox *place custom link here
  2. Dropdown place custom link here
    *where that link points to is determined by a code snippet of something like this.
    If TextBox.value = "Google"

    link points to google

    else

    link points to yahoo

    End If
    On the List page I double click on the Control and set it to custom and do something like strvalue = ...
    Since that is not possible on the Edit page. I tried using $data, xt, request(''), and dal references. All no luck.
    Thanks,

    Antoni

A
ann 8/5/2010

Antoni,
proceed to the HTML mode on the Visual Editor tab and add {$custom_link} code right to the place you want that link to be placed.

Then open Before display event on the Events tab and place a code:

sql="select FieldName from TableName where Id=" & Request("editid1")

Set rstmp = CustomQuery(sql)

if rstmp("Field1")="Google" then

xt.assign "custom_link", "<a href=http://www.google.com>www.google.com</a>";

else

xt.assign "custom_link", "<a href=http://www.yahoo.com>www.yahoo.com</a>";

end if

rstmp.close

set rstmp=nothing



where FieldName is your actual field name, Id is your actual key field name, TableName is your actual table name.