I got a winner here..
I need a solution that will use a single html select and two input fields that depend on the value selected.
This dropdown will have 3 values. If a certain values is selected, I need two input boxes to appear. If either of the other two values are selected, then no additional input boxes should be added.
This sounds like a job for AJAX i'm sure but I haven't a clue about AJAX.
What I have now is a select tag with a js onchange event that fires when the user selects the value from the select box. With php, I test for the POST var and if it is the value where I need the additional input boxes, I echo them. This is all well and good until I need to submit the page.
In theory, I setup the page using the onchange and then submit the entire page after it has been completed. This is where I have my problem because to do it like this, I would need to nest form tags and I don't think this is correct.
Does someone have a code sample they could share with me or point me in the direction that I need to go?
Thanks,
Frank
I need a solution that will use a single html select and two input fields that depend on the value selected.
This dropdown will have 3 values. If a certain values is selected, I need two input boxes to appear. If either of the other two values are selected, then no additional input boxes should be added.
This sounds like a job for AJAX i'm sure but I haven't a clue about AJAX.
What I have now is a select tag with a js onchange event that fires when the user selects the value from the select box. With php, I test for the POST var and if it is the value where I need the additional input boxes, I echo them. This is all well and good until I need to submit the page.
In theory, I setup the page using the onchange and then submit the entire page after it has been completed. This is where I have my problem because to do it like this, I would need to nest form tags and I don't think this is correct.
Does someone have a code sample they could share with me or point me in the direction that I need to go?
Thanks,
Frank
Comment