dynamically assigning value to the textbox based on precondition

i have textbox which is the following
      <input name="quiz_time_unused" type="text" id="quiz_time_unused"  class="inputbuttont" size="4" value="1500" />

i have another textbox which contain dynamic values
 <input name= "waitq" type="hidden" id="waitq"  value="{php}echo $i+1; {/php}"/>

i want to change the quiz_time_unused value using php if statement
if $i+1 = 1
then quiz_time_unused = 1500
else quiz_time_unused = 1000

LVL 11
Who is Participating?

Improve company productivity with a Business Account.Sign Up

bored321Connect With a Mentor Commented:
{php} if ($i+1 == 1){ echo "1500";} else { echo "1000"; } {/php}

Open in new window

mattibuttAuthor Commented:
i have wrote it like this doesn't seem to be working {php} is written like this because this textbox is on the smarty page

<input name="quiz_time_unused" type="text" id="quiz_time_unused"  class="inputbuttont" size="4" value="{php} if ($i+1 == 1){
else {
} {/php}"/>
mattibuttAuthor Commented:
thanks buddy
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.