Hey,
I’m using a script for hiding divs and show different divs depending on which Drop Down you choose.
So this script shows some text if I choose the Drop down with no. 1
And it shows two radiobuttons if I choose the Drop down with no. 2
The problem I have with this is that IF I get an error (due to missing info in any of the fields) the script doesn’t remember which DIV to show. So it simply shows nothing.
Here’s the link to the page: http://webbhjalpen.com/kund/frontline/open.php
Try with choosing “Typ av Ärende” - “Transportskada”
Then choose “Välj skadetyp” - “Synlig”
You will now see the radiobuttons showing up.
Now try to send away the form (press Skicka ärende) and you’ll see that the radiobuttons will disappear.
Anyone who knows how I can solve this?
Thanks!
[code][/code]
[php]
Välj här
<?
$services= db_query(‘SELECT topic_id,topic FROM ‘.TOPIC_TABLE.’ WHERE isactive=1 ORDER BY topic’);
if($services && db_num_rows($services)) {
while (list($topicId,$topic) = db_fetch_row($services)){
$selected = ($info[‘topicId’]==$topicId)?‘selected’:’’; ?>
<option value="<?=$topicId?>"<?=$selected?>><?=$topic?>
<?} }else{?>
General Inquiry
<?}?>
<div class="3">
Välj skadetyp
<?
$transportskada= db_query('SELECT id,transportskada FROM '.TABLE_PREFIX.'transportskador ORDER BY transportskada');
while (list($id,$name) = db_fetch_row($transportskada)){
$valdtransportskada = ($info['transportskada']==$id)?'selected':''; ?>
><?=$name?>
<?
}?>
<div class="second-level-container">
<div class="1"><br><b>Tidsfrist:</b>
<br>Advantage & EMO: 8dgr<br>Direct: 48h utan totalgaranti, 15dgr med totalgaranti.<br>
</div>
<div class="2">
<br>Har kund noterat på kvittens? <font class="error">* <?=$errors['noterat']?></font><br>
<?php
$noterat = (isset($_POST['noterat']) ? $_POST['noterat'] : ""); // set either posted or default value
?>
<input name="noterat" type="radio" value="Ja"<?php echo ($noterat == "Ja" ? " checked=\"checked\"" : ""); ?> />Ja
<input name="noterat" type="radio" value="Nej"<?php echo ($noterat == "Nej" ? " checked=\"checked\"" : ""); ?> />Nej
</div>
</div>[/php]