PDA

View Full Version : Dynamic FormFields (Win XP, DWCS3, PHP, JS)


norbert_ds
03-20-2009, 12:27 AM
Hi all,

I have a form field collecting The Business Address of a client. Most often the Postal Address is the same as the Business Address. Ever so often this is not the case.

What I want to do is that put a [+] link on the form which when clicked, displays the additional fields for a postal address if they are different from the business address.

Any tutorials that anyone knows about something similar?

Any help would be much appreciated.

Regards
Norbert

edbr
03-20-2009, 01:16 AM
you could use javascrpt show/hide. there was a snippet posted here a few weeks ago by coloeagle i think have a search

norbert_ds
03-20-2009, 02:15 AM
Hi Ed,

Thanks for your response, I did a search for coloeagle and unfortunately couldn't find the snippet in question.

Thanks once again.

Regards
Norbert

edbr
03-20-2009, 03:32 AM
<script type="text/javascript">
function toggle(element) {
if (document.getElementById(element).style.display == "none") {
document.getElementById(element).style.display = "";
} else {
document.getElementById(element).style.display = "none";
}
}
</script>


<a href="javascript:toggle('hidden')">+</a>

norbert_ds
03-22-2009, 05:36 AM
Hi Ed,

I ended up using Dreamweavers Spry Collapsible Tab.

In your experience is Spry ok to use? I haven't dabbled much with at all.

Also, how can I prefill the Postal Address details to be the same as the Business Address details and in the user clicks to open the Collapsible Tab, the Postal Address which is the same as Business address, is now visible for the user to edit!

Any help would be much appreciated!

Sincerely
Norbert

edbr
03-23-2009, 05:19 AM
sorry i take the 5th on spry im not really a fan and judging from this forum there have been a few problems , but im really not able to comment
I didnt really understand your question

norbert_ds
03-23-2009, 09:45 AM
Thanks anyway Ed,

I figured out the solution anyway!

Sincerely appreciate your time!

Norbert