This topic is locked

Edit by condition

4/24/2008 5:29:45 PM
ASPRunnerPro General questions
Y
yairilan author

Hi,

I need your help to restrict user for edit a record if a checkbox field in that record is checked.

For example:

If "Checkbox"=true Then "edit" lable (in the list page ) is Unvisible/Unabled.

I know it's irreversible for the user but I need the ability to lock the edit option for anyone after the Checkbox is Checked by admin.
I'll be more then happy if you can give a code example,

Tx very much,

Yair.

J
Jane 4/25/2008

Hi,
you can do the following:

  1. edit link to edit page on the Visual Editor tab.

    here is a saple:
    {if $row.allowedit}<A class=tablelinks id=editlink{$row.1recno} href="TableName_edit.asp?{$row.1editlink}">Edit</A>{/if}


2. add following code to the List page: After record processed event on the Events tab:

if rs("CheckboxFieldName")=1 then

row("allowedit") = 0

else

row("allowedit") = 1

end if

N
NigelEtienne 4/29/2009

How does this work with the inline edit option i.e. can you disable the inline edit option if the checkbox is ticked?

J
Jane 4/29/2009

What ASPRunnerPro version do you use?

N
NigelEtienne 4/29/2009

What ASPRunnerPro version do you use?


Sorry - Version 6.0 build 766

J
Jane 4/30/2009

Hi,
to hide inline edit link use following code in the List page: After record processed event for ASPRunnerpro 6.0:

if data("CheckboxFieldName")=1 then

record("inlineedit_link") = False

else

record("inlineedit_link") = True

end if

N
NigelEtienne 5/5/2009

Hi,

to hide inline edit link use following code in the List page: After record processed event for ASPRunnerpro 6.0:


many thanks - works perfectly.

J
jasoncrooke 5/27/2009

Hi , How should I go about this in asp runner 5.2 with a text value not a check box.
I have this but it dose not work,

if data("FieldName")="value" then

record("inlineedit_link") = True

else

record("inlineedit_link") = False

end if


thanks

J
Jane 5/28/2009

Hi,
you need to edit HTML code manually to show/hide InlineEdit in ASPRunnerPro 5.2.

Here is a sample:

<div {$row.style1}><A id=ieditlink{$row.1recno} onclick="return inlineEdit('{$row.1recno}','{$row.1editlink}');" ...>Inline Edit</A></div>


Then hide link using this code:

row("style1") = "style=""display:none"""

J
jasoncrooke 5/28/2009

Hi,

you need to edit HTML code manually to show/hide InlineEdit in ASPRunnerPro 5.2.

Here is a sample:
Then hide link using this code:


thanks , but where do i put the example code ?

Sergey Kornilov admin 5/28/2009

Hi,

to hide inline edit link use following code in the List page: After record processed event for ASPRunnerpro 6.0:

J
jasoncrooke 5/28/2009




hi , I need the place to put the code for asp runner 5.2 if you can please.

J
Jane 5/29/2009

Please check List page: After record processed event on the Events tab.