awpadmin Posted September 4, 2003 Posted September 4, 2003 I have a simple HTML form that I want to populate a .fp5 form. So far, I am able to make it work with only regular field names such as firstName and lastName. On my FM5.5 form I have named the same fields firstName and lastName. When I hit submit I get a
Unable Posted September 4, 2003 Posted September 4, 2003 Re: I am comfortable with the HTML syntax but new to CDML and FM5.5 syntax. Search this forum for CDML Reference db. You will find at least one link. Get the CDMLRdb. It will answer many of your syntax questions and help you with CWP. If you are using IWP, you are in for a bit of work. Since IWP generates the format files on the fly, you must understand how to control the db design necessary to get self generating format files to generate the files you desire. If you get into CWP, you will find several working examples in the Sample Files forum which may or may not give you insights in the use of the CDML syntax. You may find it easier to create your own log-in system and make the site available to "all users". Bon chance.
Anatoli Posted September 4, 2003 Posted September 4, 2003 If CustomWebPublishing check in form method="post" elseIf Instant tough luck endif
Steve T. Posted September 5, 2003 Posted September 5, 2003 LOL, Anatoli! Of course, that'd be [FMP-if] [/FMP-if], eh? AWPADMIN, As you know, the names of your form objects should match the names of your fields NAME="fieldname" (watch for spaces and special characters!). If names do not match exactly, false FMP errors can result. Check to make sure they are on the same layout that was specified by the -lay tag. Multiline text box should be same as regular text box except as TEXT AREA. Radios all have the same name/fieldname pair but different values and different displays, e.g. for fields a1, a2, a3... <INPUT TYPE="radio" VALUE="1" NAME="a3">1 <INPUT TYPE="radio" VALUE="2" NAME="a3">2 <INPUT TYPE="radio" VALUE="3" NAME="a3">3 Check boxes are complicated as there are issues pertaining to the correct displaying of a CHECKED value and the UNCHECKING OF A CHECKED BOX and have the existing value removed. I hope to post a good checkbox solution soon for all, but you can check the posts for some helpful info til then (Jeff Spall has a really good one that was almost perfect for us... he gives both a hard-coded one that uses an IF and and a valuelist one.) The posts are loaded with helpful info, too. I use the CDML Reference datbase a lot. If you don't have one, download it for free from FMP, Inc. --ST
awpadmin Posted September 9, 2003 Author Posted September 9, 2003 Steve, I was able to get a few steps further using your instructions, thank you very much. The form submits completey without error message. The radio buttons on the HTML form are still not updating the radio buttons in the FM form. Every text field is working fine. I have defined each radio button individually in FM and have the cooresponding names in my HTML form as follows: <FORM ACTION="FMPro" METHOD="POST"> <INPUT TYPE="hidden" NAME="-db" VALUE="onlineForms.fp5"> <INPUT TYPE="hidden" NAME="-format" VALUE="response.htm"> <INPUT TYPE="hidden" NAME="-lay" VALUE="volunteerForm01"> <INPUT TYPE="hidden" NAME="-error" VALUE="error.htm"> <INPUT TYPE="radio" "NAME="day1Yes" tabindex="13"> <INPUT TYPE="radio" NAME="day1No" tabindex="14"> <INPUT TYPE="radio" NAME="day2Yes" tabindex="15"> <INPUT TYPE="radio" NAME="day2No" tabindex="16"> <INPUT TYPE="radio" NAME="day3Yes" tabindex="15"> <INPUT TYPE="radio" NAME="day3No" tabindex="16"> <INPUT TYPE="radio" NAME="day4Yes" tabindex="17"> <INPUT TYPE="radio" NAME="day4No" tabindex="18"> <INPUT TYPE="radio" NAME="day5Yes" tabindex="19"> <INPUT TYPE="radio" NAME="day5No" tabindex="20"> <INPUT TYPE="radio" NAME="t1Yes" tabindex="21"> <INPUT TYPE="radio" NAME="t12No" tabindex="22"> <INPUT TYPE="radio" NAME="t2Yes" tabindex="23"> <INPUT TYPE="radio" NAME="t2No" tabindex="24"> <INPUT TYPE="radio" NAME="t3Yes" tabindex="25"> <INPUT TYPE="radio" NAME="t3No" tabindex="26"> <INPUT TYPE="radio" NAME="t4Yes" tabindex="27"> <INPUT TYPE="radio" NAME="t4No" tabindex="28"> <INPUT TYPE="radio" NAME="assist1Yes" tabindex="29"> <INPUT TYPE="radio" NAME="assist1No" tabindex="30"> <INPUT TYPE="radio" NAME="assist2Yes" tabindex="31"> <INPUT TYPE="radio" NAME="assist2No" tabindex="32"> <INPUT TYPE="radio" NAME="assist3Yes" tabindex="33"> <INPUT TYPE="radio" NAME="assist3No" tabindex="34"> <INPUT TYPE="radio" NAME="assist4Yes" tabindex="35"> <INPUT TYPE="radio" NAME="assist4No" tabindex="36"> <INPUT TYPE="radio" NAME="assist5Yes" tabindex="37"> <INPUT TYPE="radio" NAME="assist5No" tabindex="38"> <INPUT TYPE="radio" NAME="assist6Yes" tabindex="39"> <INPUT TYPE="radio" NAME="assist6No" tabindex="34">
Garry Claridge Posted September 9, 2003 Posted September 9, 2003 I think you will need to have values; e.g.: <INPUT TYPE="radio" "NAME="day1Yes" value="Yes" tabindex="13"> <INPUT TYPE="radio" NAME="day1No" value="No" tabindex="14"> <INPUT TYPE="radio" NAME="day2Yes" value="Yes" tabindex="15"> <INPUT TYPE="radio" NAME="day2No" value="No" tabindex="16"> How I would usually do something like this is: <INPUT TYPE="radio" "NAME="day1" value="Yes" tabindex="13"> <INPUT TYPE="radio" NAME="day1" value="No" tabindex="14"> <INPUT TYPE="radio" NAME="day2" value="Yes" tabindex="15"> <INPUT TYPE="radio" NAME="day2" value="No" tabindex="16"> Good Luck. Garry
awpadmin Posted September 10, 2003 Author Posted September 10, 2003 Thanks Garry. that little detail did the trick. The HTML radio buttons are now updating my FM form But you know FM does not allow you to define two identical field names for the radio buttons. They must be unique. As a result, I need to name my HTML individually too and the effect is that BOTH HTML radio buttons can be selected at the same time and it does not allow you to deselect one.
Garry Claridge Posted September 10, 2003 Posted September 10, 2003 Re: FM does not allow you to define two identical field names for the radio buttons This is not the case for me. Here is an example of some CDML I have on a "-edit" page: Yes <input type="radio" name="yes_no" value="yes" [FMP-If:yes_no.eq.yes]checked[/FMP-If] > No <input type="radio" name="yes_no" value="no" [FMP-If:yes_no.eq.no]checked[/FMP-If] > It works fine, i.e. it displays the correct value and it updates the record correctly. Good Luck. Garry
awpadmin Posted September 11, 2003 Author Posted September 11, 2003 Thanks again. Now I have to ask a novice question if you dont mind. Where and how do I exactly enter this code? [FMP-If:yes_no.eq.yes]checked[/FMP-If] [FMP-If:yes_no.eq.no]checked[/FMP-If] Will this also solve the issue of both the radio button being selected in the HTML form too?
Garry Claridge Posted September 11, 2003 Posted September 11, 2003 You would use that code if it was for a "-edit" page. However, I reread your first post and realise that it is for a "-new" page hence you do not need it. To prevent both radio-buttons being selected you need to use the same field name. Hence, this: <INPUT TYPE="radio" "NAME="day1Yes" value="Yes"> <INPUT TYPE="radio" NAME="day1No" value="No"> becomes this: <INPUT TYPE="radio" "NAME="day1" value="Yes"> <INPUT TYPE="radio" NAME="day1" value="No"> With your method of having a field for "yes" and a field for "no" I can't think of a way of doing it. Maybe some Javascript! Good Luck. Garry
Steve T. Posted September 11, 2003 Posted September 11, 2003 Hi, awpadmin! No, stick to the code Garry gave you where each button option is named the same thing as the corresponding FMP field. You also don't need the tab index if everything is going in straight-forward order anyway. Just like as he recommended... <INPUT TYPE="radio" "NAME="day1" value="Yes"> <INPUT TYPE="radio" NAME="day1" value="No"> <INPUT TYPE="radio" "NAME="day2" value="Yes"> <INPUT TYPE="radio" NAME="day2" value="No"> etc. Have fun! --ST
awpadmin Posted September 12, 2003 Author Posted September 12, 2003 Okay, I made a small modification that made it work the way I wanted to. But this may not be the proper way. I will have to revisit the radio button issue sometime later. I have taken enought your valuable time. This is what I did" I changed this: <INPUT TYPE="radio" "NAME="day1" value="Yes"> <INPUT TYPE="radio" NAME="day1" value="No"> To this: <INPUT TYPE="checkbox" "NAME="day1" value="Yes"> <INPUT TYPE="checkbox" NAME="day1" value="No"> Making the HTML code to checkbox even through the FM form has radio buttons does the trick. I am sure this is not the proper protocol. Oh well- I have to settle with it for now and try to read up more for the rest. Thank you guys again for your assistance.
Anatoli Posted September 12, 2003 Posted September 12, 2003 As I mentioned somewhere Radio buttons are working if you surround them with [FMP-If: LeftSide Operator RightSide ] ...HTML if condition is true... FULL RADIO INPUT BUTTONS CHECKED YES [FMP-Else] ...HTML if condition is false... FULL RADIO INPUT BUTTONS CHECKED NO [/FMP-If]
Recommended Posts
This topic is 7819 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now