close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Hide/unhide a field based on another's field value

Thread begun 11/18/2023 4:51 am by kost36 | Last modified 11/20/2023 4:04 pm by Patrice | 391 views | 8 replies |

kost36

Hide/unhide a field based on another's field value

Hi there
I use
<tr>
<td><strong>Disease</strong></td>
<td><select name="disease" id="disease" title="<?php echo($Recordset1->getColumnVal("disease")); ?>">
<option>Choose</option>
<option value="LCH">LCH</option>
<option value="Isolated pulmonary LCH">Isolated pulmonary LCH</option>
<option value="ECD">ECD</option>
<option value="Rosai Dorfman">Rosai Dorfman</option>
<option value="Other">Other</option>
</select></td>
</tr>
<tr>
<td><strong><label>Other</label></strong></td>
<td><input name="other" type="text" id="other" value="<?php echo($Recordset1->getColumnVal("other_disease")); ?>" size="50" maxlength="35" ></td>
</tr>

What I need is to keep the field (and the label too) "Other" hidden and unhide them only if on change, the disease's value is "Other"
Could you please help?
thank's

Sign in to reply to this post

PatriceWebAssist

If you post the URL, you may get better answers.
Is this a form? A page result using sorts?

Sign in to reply to this post

kost36

yes it's an update form
I attach the complete code
the ulr is http://adulthistio.eu/ (use the connection elements in private message)

<?php require_once('../Connections/adultlch.php'); ?>
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
<?php
$Recordset1 = new WA_MySQLi_RS("Recordset1",$adultlch,0);
$Recordset1->setQuery("SELECT tpat.* FROM tpat WHERE tpat.aapat = ?");
$Recordset1->bindParam("i", "".(isset($_GET['aapat'])?$_GET['aapat']:"") ."", "-1"); //WAQB_Param1
$Recordset1->execute();
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
 
<body>
<form id="form1" name="form1" method="post">
<p>
<input name="aapat" type="hidden" id="aapat" value="<?php echo($Recordset1->getColumnVal("aapat")); ?>" >
<table width="50%" border="1" align="center">
<tbody>

<tr>
<td><strong><label>Patient's Date of Born</label></strong></td>
<td><input name="born" type="date" id="born" value="<?php echo($Recordset1->getColumnVal("born")); ?>"></td>
</tr>

<tr>
<td width="25%"><strong><label>Patient's First Name (First Letter)</label></strong></td>
<td width="25%"><input name="pat_fname" type="text" id="pat_fname" value="<?php echo($Recordset1->getColumnVal("pat_fname")); ?>" size="5" maxlength="1"></td>
</tr>

<tr>
<td><strong><label>Patient's Father's Name (First Letter)</label></strong></td>
<td><input name="pat_faname" type="text" id="pat_faname" value="<?php echo($Recordset1->getColumnVal("pat_faname")); ?>" size="5" maxlength="1"></td>
</tr>

<tr>
<td><strong><label>Patient's Last Name (First Letter)</label></strong></td>
<td><input name="pat_lname" type="text" id="pat_lname" value="<?php echo($Recordset1->getColumnVal("pat_lname")); ?>" size="5" maxlength="1" ></td>
</tr>

<tr>
<td><strong><label>Patient's Gender</label></strong></td>
<td><select name="gender" id="gender" title="<?php echo($Recordset1->getColumnVal("gender")); ?>">
<option><?php echo($Recordset1->getColumnVal("gender")); ?></option>
<option value="M">M</option>
<option value="F">F</option>
</select></td>
</tr>

<tr>
<td><strong><label>Disease</label></strong></td>
<td><select name="disease" id="disease" title="<?php echo($Recordset1->getColumnVal("disease")); ?>">
<option><?php echo($Recordset1->getColumnVal("disease")); ?></option>
<option value="LCH">LCH</option>
<option value="Isolated pulmonary LCH">Isolated pulmonary LCH</option>
<option value="ECD">ECD</option>
<option value="Rosai Dorfman">Rosai Dorfman</option>
<option value="Other">Other</option>
</select></td>
</tr>
<tr>
<td><strong><label>Other</label></strong></td>
<td><input name="other" type="other" id="other" vvalue="<?php echo($Recordset1->getColumnVal("year_of_diagnosis")); ?>" size="50" maxlength="35" ></td>
</tr>

<tr>
<td><strong><label>Multisystem Disease</label></strong></td>
<td><select name="multi_disease" id="multi_disease" title="<?php echo($Recordset1->getColumnVal("multi_disease")); ?>">
<option><?php echo($Recordset1->getColumnVal("multi_disease")); ?></option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select></td>
</tr>

<tr>
<td><strong><label>Year Of Diagnosis</label></strong></td>
<td><input name="year_of_diagnosis" id="year_of_diagnosis" pattern="^\d{4}" value="<?php echo($Recordset1->getColumnVal("year_of_diagnosis")); ?>"></td>
</tr>

<tr>
<td><strong><label>Histological diagnosis</label></strong></td>
<td><select name="histological_diagnosis" id="histological_diagnosis" title="<?php echo($Recordset1->getColumnVal("histological_diagnosis")); ?>">
<option><?php echo($Recordset1->getColumnVal("histological_diagnosis")); ?></option>
<option value="Yes">Yes</option>
<option value="No">No</option>
<option value="from BAL">from BAL</option>
</select></td>
</tr>

<tr>
<td><strong><label>Mutation</label></strong></td>
<td><select name="mutation" id="mutation" title="<?php echo($Recordset1->getColumnVal("mutation")); ?>">
<option><?php echo($Recordset1->getColumnVal("mutation")); ?></option>
<option value="BRAF">BRAF</option>
<option value="non-BRAF">non-BRAF</option>
<option value="None">None</option>
<option value="Not examined">Not examined</option>
</select></td>
</tr>

<tr>
<td><strong><label>Active Disease</label></strong></td>
<td><select name="active_disease" id="active_disease" title="<?php echo($Recordset1->getColumnVal("active_disease")); ?>">
<option><?php echo($Recordset1->getColumnVal("active_disease")); ?></option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select></td>
</tr>

<tr>
<td><strong><label>Under Treatment</label></strong></td>
<td><select name="under_treat" id="under_treat" title="<?php echo($Recordset1->getColumnVal("under_treat")); ?>">
<option><?php echo($Recordset1->getColumnVal("under_treat")); ?></option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select></td>
</tr>

<tr>
<td><strong><label>Year From Diagnosis</label></strong></td>
<td><input name="years_diagnosis" id="years_diagnosis" pattern="^\d*(\.\d{0,2}?$)" value="<?php echo($Recordset1->getColumnVal("years_diagnosis")); ?>"></td>
</tr>

<tr>
<td><strong><label>Date Of Registration</label</strong></td>
<td><input name="date_of_registration" type="datetime-local" id="date_of_registration" value="<?php echo($Recordset1->getColumnVal("date_of_registration")); ?>"></td>
</tr>

<tr>
<td><strong><label>Date Of Last Update</label></strong></td>
<td><input name="date_of_last_update" type="datetime-local" id="date_of_last_update" value="<?php echo($Recordset1->getColumnVal("date_of_last_update")); ?>"></td>
</tr>


<tr>
<td colspan="2" align="center" style="text-align: center"><input name="Update" type="submit" id="Update" formaction="../app/update.php" formmethod="GET" value="Update"></td>
</tr>
</tbody>
</table>
</form>
</body>
</html>

Sign in to reply to this post

PatriceWebAssist

To restate:
Private messages can't be used right now to find solutions.
Ray has passed away.
The forum now is relying on one another to find answers.

If you want help, the private area doesn't come into play.
No need to post user/pass in private.
If you want help, post a public URL.

Sign in to reply to this post

kost36

so sorry to hear that Ray has passed away... I am socked... I don't believe it...
Anyway, I posted the complete code and the live url but in order someone to see it live must be an administrator

Sign in to reply to this post

PatriceWebAssist

Yes, that is my point. Right now, we don't have an admin. We are helping one another so if you want help, you have to share details. I am the "admin" temp here but only to keep off spam. You will need to trust fellow peeps here for a while to get any help. It will all sort out in the end, but for right now, it is what it is.
I can see your user/pass in private. But I can't help you as I am a mere user, not an expert. Use the deep knowledge of all of the peeps on this list to get help.

Sign in to reply to this post

kost36

This post has been deleted.

kost36

fixed with a piece of java script
thank's

Sign in to reply to this post

PatriceWebAssist

Would you be willing to share the solution in case someone else needs it?

Thank you.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...