Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I'm struggling with making a form I am working with sticky. I have everything working just as I'd like and submitting to Filemaker, I just need to make the radio buttons sticky. I am missing something, in the syntax and it has me stumped. I anyone can point me in the right direction it would be greatly appreciated.

This line works.

$html .= '<td width="25%" align="center"><input type="radio" name="regcheckin" value="Poor" /> </td>';

This line does not work.

$html .= '<td width="25%" align="center"><input type="radio" name="regcheckin" value="Poor"' if ($_POST['regcheckin'] == 'Poor') echo'checked="checked"'' /> </td>';

I'd like the second line to work if possible.

Here is how I'd do it:

if ($_POST['regcheckin'] == 'Poor'){

$checkedval =' checked="checked" '};//note the spaces before and after the text!

} else {

$checkedval = '':

}

$html .= '<td width="25%" align="center"><input type="radio" name="regcheckin" value="Poor"'. $checkedval .' /> </td>';

Syntax looks fine. I'd suggest you debug what's actually getting posted... at the top of your form processing page (presumably this page), chuck in a

print_r($_POST);

and take a look at the output

From the code you've pasted above, in the second example you have [value="Poor"'] - there's an extra quote there - might be breaking your post content.

The syntax in the original second example isn't really OK, as it has an invalid If statement in the middle of it... The first suggestion looks good, or you could do something like:


$html .= '<td width="25%" align="center"><input type="radio" name="regcheckin" value="Poor"';

if ($_POST['regcheckin'] == 'Poor') {

$html .='checked="checked"'

}

$html .=' /> </td>';

  • Author

Thank for the help everyone. This is the code I got working.

I need to do more reading on how spacing impacts the code. I was really hoping to get it all on one line but it took a few.


    $html .= '<td width="25%" align="center"><input type="radio" name="regcheckin" value="Poor"'; if($_POST['regcheckin'] == 'Poor'){

    $html .= 'checked="checked"';}

    $html .= ' /> </td>';

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.