capt_nemo777
12-01-2010, 07:00 AM
I have a registration form, wherein, it has a dropdown menu of pre-made questions to serve as secret questions. then I added a "write my own secret question" link wherein, if I click this link, it'll hide the dropdown menu and then show a textbox instead.
here's my jquery script
<script>
$(document).ready(function(){
$('#textSecret').css('display','none');
$('#ownSecret').click(function(){
$('#dropSecret').hide();
$('#textSecret').show();
$ ('#ownSecret').hide();
});
});
</script>
here's the php code snippet
<div id="dropSecret" class="row">
<?php echo CHtml::activeLabelEx($form,'WSMembershipSecretQuestion'); ?>
<?php echo CHtml::activeDropDownList($form,'WSMembershipSecretQuestion',$form->getSecretQuestions()); ?>
</div>
<?php echo CHtml::link('write my own secret question','#',array('id'=>'ownSecret')); ?>
<div id="textSecret" class = "row">
<?php echo CHtml::activeLabelEx($form,'WSMembershipSecretQuestion'); ?>
<?php echo CHtml::activeTextArea($form,'WSMembershipSecretQuestion', array('rows' => 2,'cols' =>15)); ?>
</div>
<div class = "row">
<?php echo CHtml::activeLabelEx($form,'WSMembershipSecretAnswer'); ?>
<?php echo CHtml::activeTextField($form,'WSMembershipSecretAnswer'); ?>
</div>
now the problem is, this
http://i53.tinypic.com/kd9ysw.jpg
the dropdown menu questionaire doesn't seem to get recognized when I submit the form..it only knows the text box version for writing own question when they both have the same attribute name :confused:
what should I do ?
here's my jquery script
<script>
$(document).ready(function(){
$('#textSecret').css('display','none');
$('#ownSecret').click(function(){
$('#dropSecret').hide();
$('#textSecret').show();
$ ('#ownSecret').hide();
});
});
</script>
here's the php code snippet
<div id="dropSecret" class="row">
<?php echo CHtml::activeLabelEx($form,'WSMembershipSecretQuestion'); ?>
<?php echo CHtml::activeDropDownList($form,'WSMembershipSecretQuestion',$form->getSecretQuestions()); ?>
</div>
<?php echo CHtml::link('write my own secret question','#',array('id'=>'ownSecret')); ?>
<div id="textSecret" class = "row">
<?php echo CHtml::activeLabelEx($form,'WSMembershipSecretQuestion'); ?>
<?php echo CHtml::activeTextArea($form,'WSMembershipSecretQuestion', array('rows' => 2,'cols' =>15)); ?>
</div>
<div class = "row">
<?php echo CHtml::activeLabelEx($form,'WSMembershipSecretAnswer'); ?>
<?php echo CHtml::activeTextField($form,'WSMembershipSecretAnswer'); ?>
</div>
now the problem is, this
http://i53.tinypic.com/kd9ysw.jpg
the dropdown menu questionaire doesn't seem to get recognized when I submit the form..it only knows the text box version for writing own question when they both have the same attribute name :confused:
what should I do ?