0

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

Mat
  • 202,337
  • 40
  • 393
  • 406
rachel
  • 225
  • 2
  • 5
  • 16

1 Answers1

0

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>
cHao
  • 84,970
  • 20
  • 145
  • 172