[RESOLVED] Need Help to this case ...
Hello, I have some problem...
Example, I have questions :
1.
a. Do you have a car ? ( ) Yes ( ) No ( ) Not Answer
b. If Yes, Do you want to sell your car if your car is damaged ? ( ) Yes ( ) No
If I choose 1a, YES, then question 1b will appear, otherwise, it will dissapear (like hidden ...)
Is there any sollutions...(Because there are some people which choose 1a, No and Answer 1b too, if i don't handle this problem)? :bigyello: :bigyello:
Thank you for your answers...
Re: Need Help to this case ...
Maybe something like...
Code:
<form action="" method="post">
Do you have a car?
<input type="radio" name="car" value="yes"
onclick="this.form.sellDamaged[0].disabled=false; this.form.sellDamaged[1].disabled=false;" /> Yes
<input type="radio" name="car" value="no"
onclick="this.form.sellDamaged[0].disabled=true; this.form.sellDamaged[1].disabled=true;" /> No <br />
Do you want to sell your car if your car is damaged?
<input type="radio" name="sellDamaged" value="yes" /> Yes
<input type="radio" name="sellDamaged" value="no" /> No <br />
</form>
Re: Need Help to this case ...
Thank you,
but Can you make it not visible ???
Re: Need Help to this case ...
Try putting the relevant portion within a DIV, give it an ID, and then use the same method I showed to toggle it's .visibility.
Re: Need Help to this case ...
Re: Need Help to this case ...
I only tested it in IE 6 and the latest Firefox, not sure what browsers it'll work in:
Code:
<html>
<head>
<title></title>
<style type="text/css">
</style>
<script type="text/javascript">
function hideIt(theElement) {
document.getElementById(theElement).style.visibility = 'hidden';
}
</script>
</head>
<body onload="hideIt('sellDamagedDIV');">
<form action="" method="post">
Do you have a car?
<input type="radio" name="car" value="yes"
onclick="document.getElementById('sellDamagedDIV').style.visibility = 'visible';" /> Yes
<input type="radio" name="car" value="no"
onclick="document.getElementById('sellDamagedDIV').style.visibility = 'hidden';" /> No <br />
<div id="sellDamagedDIV">
Do you want to sell your car if your car is damaged?
<input type="radio" name="sellDamaged" value="yes" /> Yes
<input type="radio" name="sellDamaged" value="no" /> No <br />
</div>
</form>
</body>
</html>
Re: Need Help to this case ...
WOW...
THANK YOU VERY MUCH..... :D :D
But Why I can't take it to table ...?
Like :
<div id='P6b'>
<tr>
<td width=5% align='right' class="Header" ></td>
<td width=53% class="Header" ></td>
<td class="Header" width=14% ><input name='Opt6b' type='radio' value=0 >xxxxxx</td>
<td class="Header" width=14%><input name='Opt6b' type='radio' value=1 >xxxxxx</td>
<td class="Header" width=14%><input name='Opt6b' type='radio' value=2>xxxxxx</td>
</tr>
</div>
b) Sorry, another question....
If I have Table (Mysql) with "TEXT" type, Why I can't show it to next line when there is a character "Return / Enter" with PHP (Only one line...,There should be 2 line or more) ??? :confused: :confused:
Re: Need Help to this case ...
I don't know...it works fine for me in IE and Firefox. Are you sure you changed the code from sellDamagedDIV to P6b?
For your TEXT field, you're going to want to do something like this:
Code:
echo nl2br($result['fieldName']);
This will add the html tag <br /> where newline characters are present.
Re: Need Help to this case ...
Ah, you have to have the entire table within the DIV, not just part of it, ie:
Code:
<div>
<table>
...
</table>
</div>
as opposed to:
Code:
<table>
<div>
...
</div>
</table>