473,394 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Hidden Form items with javascript

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
4 1293
gits
5,390 Expert Mod 4TB
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
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
gaya3
184 100+
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
5,390 Expert Mod 4TB
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

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

Similar topics

10
by: Randell D. | last post by:
Folks, Perhaps someone can figure this out - this is 'the process of my script' I have a form whereby I can add multiple contacts to a single address. There is only one...
13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
6
by: GoCMS | last post by:
Hi, guys: I am trying debug other people(who has left company)'s ASP code, and had difficulty understanding the use of a hidden asp page. The application has an index page, like MyIndex.asp...
2
by: Ron Aronica | last post by:
I want to specify the value of an input field using the return from a function. I want to do something this this: <script> function value() { return "the value"; } </script> <form>
1
by: Sam Wuebben | last post by:
I would like to add a few hidden field values to a form as it is submited via JavaScript. I have a static page shopping site that uses MIVA shopping cart. Some of the pages are getting quite...
10
by: Mark McLellan | last post by:
Dear all Following the oft-repeated advice here and ciwas I have made my site nearly 4.01 strict (working on it). There are some items on which I would appreciate your advice: 1. Hidden...
1
by: Wim | last post by:
Hi Everyone, I'm trying to speed up a Asp.net 1.1 applications' performance. The application needs to run in an environment with little bandwith and therefore pagesizes and roundtrip times shoud...
2
by: Bill Steele | last post by:
I want to have a window pop up with a form. When the form is submitted, it needs to pass along the URL of the original window. If find on th web eight gazillion descriptions of how to pass data...
7
by: parag1234567 | last post by:
Hi, I am dynamically generating a html file which will contain only <div> tags which contents are hidden from user( set by style="visibility:hidden") Now the next step is i am enabling some of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.