Disable Command Button in IC (Interchange)

155 views Asked by At

I want to disable my command button when the no of hits reach 100 ,retrieving no of hits from mysql using IC.

I am doing something like this but its not working.

my $cc= [sql-param hits];
[if $cc>= 100 ]
<input type="Submit" name="cv" value="Vote" disabled="true"><br /><br />
[/if] 

Thanks Isha

1

There are 1 answers

0
cHao On

You'll probably want to stick with ITL, if you can. You shouldn't need Perl code for this.

I haven't messed with IC in a while, but something similar to this (within the [query] tag, of course) might work...

[if-sql-param hits >= 100]
 <input type="submit" name="cv" value="Vote" disabled="disabled"><br><br>
[/if-sql-param]

I'm not seeing the point of outputting either a disabled button or nothing, though. You might just want to output the "disabled" attribute if the condition's true.

<input type="submit" name="cv" value="Vote" 
 [if-sql-param hits >= 100] disabled="disabled"[/if-sql-param]>
<br>
<br>