Discussion:
Newbie question
Erwin Noever
2014-07-02 15:32:24 UTC
Permalink
I have made a form and have used radiobuttons so people can choose a
membership.

example:

<input type="radio" name="normalmember" value="normal member">normal
member<br>
<input type="radio" name="familymember" value="family member">Family
member<br>
<input type="radio" name="youthmember" value="youth member">youth member

Now my question is if it is possible when they click on family member or
youth member that beneeth that option comes 2 fields 1. name and 2. date of
birth.

I realy dont know how it can be done, so if some one can help on the may it
will be much apreciated and i can learn more and experiment with it.

Thanks in advance.

Erwin
Jim Lucas
2014-07-02 16:08:22 UTC
Permalink
Post by Erwin Noever
I have made a form and have used radiobuttons so people can choose a
membership.
<input type="radio" name="normalmember" value="normal member">normal
member<br>
<input type="radio" name="familymember" value="family member">Family
member<br>
<input type="radio" name="youthmember" value="youth member">youth member
Now my question is if it is possible when they click on family member or
youth member that beneeth that option comes 2 fields 1. name and 2. date of
birth.
I realy dont know how it can be done, so if some one can help on the may it
will be much apreciated and i can learn more and experiment with it.
Thanks in advance.
Erwin
Yes, what you are asking can be done. But not with PHP. You will need to use
Javascript on the client side to make this happen. Research "onclick" and
find yourself a nice tutorial on how to add DOM elements dymaically with
javascript.
--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jim Giner
2014-07-02 16:15:05 UTC
Permalink
You must also assign the same name=... to your radio buttons otherwise
one could click on all three of them, instead of selecting just the one
you want.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Negin Nickparsa
2014-08-10 23:26:09 UTC
Permalink
you can begin here and expand it,also whenever your interaction is with
browser it has nothing to do with php


<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
"></script>
<script type="text/javascript">
$( document ).ready(function() {
$('#details').css("display","none");
$("#familymember").click(function(){
{
$('#details').css("display","block");
}
});
});
</script>
<input type="radio" id="normalmember" value="normal member">normal
member<br>
<input type="radio" id="familymember" value="family member">Family
member<br>
<div id="details">
Name:<input type="text"><br>
Date of Birth:<input type="text"><br>
</div>
<input type="radio" name="youthmember" value="youth member">youth member



Sincerely
Negin Nickparsa
You must also assign the same name=... to your radio buttons otherwise one
could click on all three of them, instead of selecting just the one you
want.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...