All,
I recently started using JQuery and I am facing one issue I could not
resolve. I hope this is possible with Jquery.
I have the following :
<script type="text/javascript">
$(document).ready(function(){
// this section display the div "toBeDisplayed" only if #protected'
equals to Y
  $('#protected').change(function(){if ($(this).val()=='Y' ) $('#
toBeDisplayed').show("slow");else $('#toBeDisplayed').hide();});
});
</script >
...
<form ... >
<p><label for='protected'></label>
<select name = 'protected'>
<option label="" value=""></option>
<option label="Oui" value="Y" selected="selected">Yes</option>
<option label="Non" value="N">No</option>
</select>
</p>
<div id='toBeDisplayed' style="display:none">
<p>additional field to completed</p>
</div>
</form>

I am using PHP, and I would like to ensure that the form is validated
through PHP prior saving data into DB;
if some fields are not validated, an error message is displayed with
the information already entered.

Where I am facing issues is when the form has been posted with the div
"toBeDisplayed" with a show status and value entered in that div;
How can I have this DIV displayed with Jquery ? Is there any way to
set a value (div to be shown) when the form is loaded ?

Thanks in advance.
Jacques

Reply via email to