Challenge: Check a checkbox for a custom field
This is the "before" condition using one of the signup pages from my test account. You'll see that the checkbox is not checked, and I really would like people to start receiving the Longhorn Letters.
- We'll start by viewing the signup page. Click on the "View Page" link, and the signup page will appear.
- Next, view the HTML for the page. This sounds complicated, but it's not. All you have to do is to type control-U on a PC, or command-U on a Mac. You can also right-click on the page (or control-click on a Mac) and choose "View Source".
When you do, then the HTML page will pop up. If you think that it looks like a lot of gobbledy-goop, then you would be correct! However, it is useful goop, since it tells the browser how to display the page to the user.
- Now, search for the text that's right by the checkbox. In my case, the text starts off with "I would like to", so I am searching for that.
- Once you have found the text, then you will see something very similar to this:
- Now that you've found the label with the text that you were looking for, go to the next <input> tag, and find the name. Highlight the name and the equal sign and the quoted value. In my case, I am highlighting "name='longhorn'". Once it's highlighted, copy it using control-C or command-C.
- Edit the signup page.
- Click on the "Other Text" tab.
- Paste in the text that we copied from the goop. We do not want to lose it!
Next, copy the script (below) and paste it in underneath the text that we just copied. When you are done, you should see something like this:
Now select and cut the name='whatever' string again, and replace "oooo" with it. When you are done, you will have something like this:
- Save your signup page, and you are done!
Now, when you run your signup page, you'll see that the checkbox custom field is already checked. Here's what mine looks like:
I hope that this was all very helpful to you. If you have questions or suggestions, then please send me some mail at email@example.com. Hope y'all have an excellent week!