This topic is locked

How I can disabled the bottom 'Add new'?

2/16/2008 4:18:30 PM
ASPRunnerPro General questions
S
Santiagox author

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=7583&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' /> Hello, all. I need help for show or disable the 'Add new' bottom in add pages dependent if masterkey value is empty or not... Thanks

J
Jane 2/19/2008

Hi,
you can do the following:

  1. proceed to the Visual Editor tab, turn on HTML mode, find this code:
    <SPAN class=buttonborder><INPUT class=button onclick="window.location.href='DetailTableName_add.asp'" type=button value="Add new"></SPAN>



and replace it with this one:

{if $masterkeyfound}

<SPAN class=buttonborder><INPUT class=button onclick="window.location.href='DetailTableName_add.asp'" type=button value="Add new"></SPAN>

{/if}


2. then add following code to the List page: before display event on the Events tab:

if Request.QueryString("masterkey1")="" then

smarty("masterkeyfound") = 0

else

smarty("masterkeyfound") = 1

end if

S
Santiagox author 2/19/2008