Jump to content

More of a javascript question... but..


dmaru09

Recommended Posts

I'm making a new system for my company.. making an input form currently.

 

What I am trying to do is make a checkbox that when unchecked makes two fields cleared and invisible.

 

<TR>

<TD>

<input type='checkbox' onclick=\"document.getElementById('text12').value='';\" onclick=\"document.getElementById('text1').value='';\" onPropertyChange='showHide(whatever);' />

</td>

<TD>

<INPUT TYPE='text' id='text1' NAME='a_due_date_1' VALUE='".$_SESSION['due_date_1']."' SIZE='20'></TD>

</TD>

  <TD><INPUT TYPE='text' id='text12' NAME='a_payment_1' VALUE='".$_SESSION['payment_1']."' SIZE='20'></TD>

  <TD><P CLASS='error'>".$_SESSION['e_due_date_1']."</TD>

</TR>

 

The way this currently works is both field are invisible when unchecked, which is what I want to happen.  (Javascript uptop controls that) -- not the prob.  The problem is that when checked/unchecked the only field that is cleared is 'text12' as that is the field that comes first.  --- Doesn't matter if both fields are identified by text12, thats why I made them both have different names.

Link to comment
https://forums.phpfreaks.com/topic/164383-more-of-a-javascript-question-but/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.