I haven’t tried it yet. I know how to get one form on a page, but I need to have two forms on a single page. I’ve been using a second form as a markup item, but I’d like to have two forms by letting Freeway add them, as I’m getting a validation error @ WCW validation. The page displays properly, but I’d like to get verified.
There is a set of Actions called Multiple Forms, and it allows you to do this. The issue is that if you have any sort of a regular Freeway form object on the page, Freeway will put a FORM tag just inside the BODY, and any other form you add will be nested inside that. Technically speaking, it won’t work, although some browsers don’t mind.
The Multiple Forms Action has one component that removes this outer form, and then you draw a Multiple Form on the page wherever you need a form. That makes the form tags separate from one another, as peers. The page will be valid, and will actually work predictably in any browser.
Is there anyway to add code to the submit button? I checked the action pallet and the inspector but didn’t see that option.
If you make your submit button in Freeway, then you can add this using the Item / Extended dialog in Freeway. Add a new options in that dialog, and in the Name field enter onclick and in the Value field, enter whatever you need for that.
Thanks Walter- Your a life/time saver. Every time I learn something new in Freeway I’m so impressed at how powerful this application actually is. And when I think I’m using some of the advanced features, I find that there are other things that I can do to make my life much easier.
Ok… I’m soooo almost there. The form is setup using the Multiple Forms action, I have the onclick within the button. The only thing now I’m trying to figure out is how to get target="_self" within the tag. Within the action panel, there is no option to extend the tag there, and you can’t use the standard Form Setup…
If I can’t get this last thing, it’s not much of a biggie, but I’d like to have the target parameter in there as well.
_self is the default target. The only reason you would ever have to set it on the form is if you set a different target on the page itself, but wanted to make sure the form posted to itself. Do you find that you need this setting? If you set the Action of the form to the page filename, that should work.
Try opening that Action with a text editor, like BBEdit or TextMate. If it doesn’t look like a bunch of hash (encoded for Express) then you can add a field to it pretty easily. Look at how the Name field is added:
Then further down in the Action, that value gets added to the form like this:
form.name = '"'+fwParameters.Name+'"';
So you would add a text field called Target in the next line after the Name:
and then right after the form.name = line, you would add this: