Nesting a Form within a Form

Results 1 to 3 of 3

Thread: Nesting a Form within a Form

  1. #1
    Join Date
    Dec 1969

    Default Nesting a Form within a Form

    Dear All,<BR><BR>I&#039;d like to ask a question on Nested Forms, I have a database consisting of 3 tables and I&#039;d like to build an intranet so clerks can key in data into our MSSQL database :<BR><BR>I have a database and currently, the entity list is :<BR>company :<BR><BR>(#company_id, #state_id, #id_number, company_name, business_type, country_code, area_code, phone_number, fax_number, number_of_branches, address_status)<BR>where company_id, state_id and id_number are the compound keys forming the primary key for this table.<BR><BR>address :<BR><BR>(#company_id, #state_id, #id_number, lot_num, street_name, district, state, postcode, country, e_mail) where the same 3 keys are the foreign keys to link to company.<BR><BR>employee :<BR><BR>(#employee_id, username, password, employee_name)<BR><BR>I now have a form with all the fields of company in it and I&#039;d like to know how to enable the form so, if address_status is "Yes", a second nested form will become visible and when submited, data from both forms will be saved into the database.<BR><BR>Second question : <BR><BR>I&#039;d like to make pull-down menus for company_id and state_id, and then the user will fill in the id_number of the company in the first form. These 3 fields are situated together, my question is : how do you combine these 3 fields into one field in order to save it into the database? Would this create complications? If so, what?<BR><BR>Any help given will be most appreciated! Thank you!<BR><BR>Eowyn<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default First of all I would like to add

    that the DB need to change a little. The employee table should have a field Company_id which will associate the employee with a company.<BR><BR>Also I don&#039;t understand why do you need the #id_number field in the two tables. It looks redundant to me.<BR><BR>To answer your first question:<BR>You will need to submit the form to itself when the address_status field becomes YES.<BR><BR>Second question:<BR>I will say that it won&#039;t be a good idea to put all the three into one field. Because then everytime before insert you need to concatenate the three. Worse would be when you would want to retrieve the values back from the table. Splitting the values will be a tough job logistically.<BR><BR>But still if you want to do that, it is easy.<BR><BR>Concaenate them and put that into one variable and then insert the variable into the table.<BR><BR>Concatenated_value = #company_id & #state_id & #id_number<BR><BR>Or better put a delimiter in between to help splitting the value when retrieving from the database.<BR><BR>Concatenated_value_with_delimiter = #company_id & "DELIMIT" & #state_id & "DELIMIT" & #id_number<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default You *CAN NOT* nest forms.

    Period.<BR><BR>HTML doesn&#039;t allow it!<BR><BR>Netscape browsers won&#039;t even display the page. <BR><BR>MSIE will display it, perhaps with side effects, but none of the submits will work properly.<BR><BR>

Posting Permissions

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