Check box and radio button Please help

Results 1 to 2 of 2

Thread: Check box and radio button Please help

  1. #1
    Dia Guest

    Default Check box and radio button Please help

    How to check the value of a check box in VBScripting. I have a form<BR>and there are two address. for example technical contact and administrative contact. i have a check box in technical contact saying that " same as administrative contact" . So if the check box is checked<BR>then transfer all the values of admintrative contact in the technical contact text boxes . if not checked then leave blank.<BR>More over i am checking other validation of administrative contact text boxes onclick of that check box so if the email address of the admintrative is wrong then display the message and uncheck that check box also.<BR>I am using function in vb scripting ,and calling that function in onclick event of that checkbox. if there is another of doing this work Do help me for the sake of programming.<BR>thank you in advance .<BR>

  2. #2
    PJ Guest

    Default Use JavaScript instead

    Insert this script in the page head. Then put the rest in the body. Enter text into the first box then click the checkbox. You can customize it and add new fields. For this to work you must have the form elements inside those form tags. You also need to have that small line of code in the checkbox. What&#039s important is that the names of your form elements match eerywhere you use them. Hope this gets you rolling.<BR><BR>&#039put this in the head...<BR>&#060;SCRIPT LANGUAGE="JavaScript"&#062;<BR>&#060;!-- Begin<BR>var tech_contact = "";<BR>var admin_contact = "";<BR>function InitSaveVariables(form) {<BR>tech_contact = form.tech_contact.value;<BR>}<BR>function InitSaveVariables2(form) {<BR>admin_contact = form.admin_contact.value;<BR>}<BR>function TechToAdmin(form) {<BR>if (form.copy.checked) {<BR>InitSaveVariables2(form);<BR>form.admin_conta ct.value = form.tech_contact.value;<BR>}<BR>else {<BR>form.admin_contact.value = admin_contact;<BR> }<BR>}<BR>// End --&#062;<BR>&#060;/script&#062;<BR><BR>&#039 put this in the body...<BR>&#060;form method="post" action="wherever.asp"&#062;<BR>&#060;input type="text" name="tech_contact"&#062;<BR>&#060;input type="text" name="admin_contact"&#062;<BR>&#060;input type="checkbox" name="copy"<BR>OnClick="javascript:TechToAdmin(thi s.form);" value="checkbox"&#062;<BR>&#060;/form&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts