By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,483 Members | 3,229 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,483 IT Pros & Developers. It's quick & easy.

Hidden Form items with javascript

P: 27
Hello All,

Can someone tell me if this is possible, and if so, please direct me in the right direction on a method>

I have a form, with radio buttons.... each question has 3 possible radio selections... either yes, no , or no answer.

What I want to do, is hide individual questions based on the day, or a time of day.


Any help would be great,

Thanx,
Patsman77
Jan 8 '08 #1
Share this Question
Share on Google+
4 Replies


gits
Expert Mod 5K+
P: 5,333
hi ...

it is possible :) ... please post an example-code (html or even the js) you already have ... so that we have something to work with ... and explain a short use-case for what you want to achieve with the posted code ... so that we might give you an example for this problem ...

kind regards
Jan 8 '08 #2

P: 27
here is a small chunk of the code I have so far.

[HTML]<TR>
<TD bgcolor="#C0C0C0" width="300"><FONT COLOR="#000000"><INPUT TYPE="radio" value="<?php echo $pass[Favorite]; ?> -<?php echo $pass[Spread]; ?>" NAME="Game01" <? if($pass[Game01]== "$pass[Favorite] -$pass[Spread]"){ echo "checked"; } ?>></FONT><?php echo $pass[Favorite]; ?>
</TD>
<TD bgcolor="#C0C0C0"><CENTER><?php echo $pass[Spread]; ?></CENTER></TD>
<TD bgcolor="#C0C0C0" width="300"><FONT COLOR="#000000"><INPUT TYPE="radio" value="<?php echo $pass[Underdog]; ?> +<?php echo $pass[Spread]; ?>" NAME="Game01" <? if($pass[Game01]== "$pass[Underdog] +$pass[Spread]"){ echo "checked"; } ?>></FONT><?php echo $pass[Underdog]; ?></TD>
<TD VALIGN=BOTTOM bgcolor="#C0C0C0" width="31"> <font size="1" </font>&nbsp;<?php echo $pass[Day]; ?></TD>
<TD VALIGN=BOTTOM bgcolor="#C0C0C0" width="31"> <font size="1" </font>&nbsp;<?php echo $pass[Time]; ?></TD>
<TD VALIGN=BOTTOM bgcolor="#C0C0C0" width="54"><font color="#FFFFFF"><INPUT TYPE="radio" value=" " NAME="Game01" <? if($pass[Game01]==""){ echo "checked"; } ?>>None</font></TD>
</TR>
<TR>
<TD bgcolor="#C0C0C0" width="300"><FONT COLOR="#000000"><INPUT TYPE="radio" value="<?php echo $pass[Favorite2]; ?> -<?php echo $pass[Spread2]; ?>" NAME="Game02" <? if($pass[Game02]== "$pass[Favorite2] -$pass[Spread2]"){ echo "checked"; } ?>></FONT><?php echo $pass[Favorite2]; ?>
</TD>
<TD bgcolor="#C0C0C0"><CENTER><?php echo $pass[Spread2]; ?></CENTER></TD>
<TD bgcolor="#C0C0C0" width="300"><FONT COLOR="#000000"><INPUT TYPE="radio" value="<?php echo $pass[Underdog2]; ?> +<?php echo $pass[Spread2]; ?>" NAME="Game02" <? if($pass[Game02]== "$pass[Underdog2] +$pass[Spread2]"){ echo "checked"; } ?>></FONT><?php echo $pass[Underdog2]; ?></TD>
<TD VALIGN=BOTTOM bgcolor="#C0C0C0" width="31"> <font size="1" </font>&nbsp;<?php echo $pass[Day2]; ?></TD>
<TD VALIGN=BOTTOM bgcolor="#C0C0C0" width="31"><font size="1" </font>&nbsp;<?php echo $pass[Time2]; ?></TD>
<TD VALIGN=BOTTOM bgcolor="#C0C0C0" width="54"><font color="#FFFFFF"><INPUT TYPE="radio" value=" " NAME="Game02" <? if($pass[Game02]==""){ echo "checked"; } ?>>None</font></TD>
</TR>[/HTML]

basically, I want to compare the [Day] and [Time] variables to current Day and time. If it is before the current Day and Time, then the selections are accessible, other wise then that, if it is after the Day and Time, to hide the radio buttons so no choice can be made.

Thanx in advance, If you need more code, please just let me know.

Patsman77
Jan 9 '08 #3

100+
P: 184
Hello All,

Can someone tell me if this is possible, and if so, please direct me in the right direction on a method>

I have a form, with radio buttons.... each question has 3 possible radio selections... either yes, no , or no answer.

What I want to do, is hide individual questions based on the day, or a time of day.


Any help would be great,

Thanx,
Patsman77

Hi,
Its possible...
what u want to do is simple...
u have to call onLoad() function,in that u can find the day... and code ur logic..

-Thanks
Hamsa
Jan 9 '08 #4

gits
Expert Mod 5K+
P: 5,333
hi ...

to retrieve the date and time you may use javascripts Date Object ... with that you may compare your dates/times and handle the 'selectablity' ... may be you could set a disabled-attribute for the checkboxes ...

kind regards
Jan 9 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.