Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value changing on checkboxes in Chrome #1125

Closed
ghost opened this issue Jan 13, 2016 · 11 comments
Closed

Value changing on checkboxes in Chrome #1125

ghost opened this issue Jan 13, 2016 · 11 comments

Comments

@ghost
Copy link

ghost commented Jan 13, 2016

Hi, Mottie - me again!

I have this strange problem that only occurs in Chrome. It seems that whenever one of the checkboxes (I only have one, per row) is checked, the value of the checkbox changes from the original one (the intended value which should remain) to "true" instead.

Unchecked (original) code:
<input type="checkbox" name="selected_reminder_uid" class="reasign" value="5310" unchecked>

After checking the box:
<input type="checkbox" name="selected_reminder_uid" class="reasign" value="true" checked>

Obviously, I need the value in the second line to remain "5310" instead of "true". Do you know why this is happening? When I render my pages without the tablesorter plugin, this behavior does not occur, even in Chrome (so there is something happening with TS that is doing this.)

@Mottie
Copy link
Owner

Mottie commented Jan 13, 2016

Hi @aetna-wsa!

I think different browsers treat the value of a check box input different. I would not use value, instead use data-value or another attribute.

@ghost
Copy link
Author

ghost commented Jan 13, 2016

Thanks, Rob. I thought about that. However, on the same page that uses the value attribute it is correctly leaving the value unchanged when checking the checkbox. The difference between these pages are just the use of the TS plugin and using the parser-input-select.js file. Any reason why TS would cause this to be an issue while the page without it works fine?

@JamoCA
Copy link

JamoCA commented Jan 14, 2016

I've had an app that has worked for a year or more... updating the latest version of "parser-input-select.js" rewrites the submitted value to "true" instead of the unique IDs that are configured in the form. The latest versions of Firefox Dev & Microsoft Edge don't rewrite the values to "true". If I remove the input-select plugin, the form fields are correctly submitted.

@Mottie
Copy link
Owner

Mottie commented Jan 14, 2016

Hmm, ok I'll take a look at the code again.

@Mottie
Copy link
Owner

Mottie commented Jan 14, 2016

Ok, the parser is fixed in the master branch. Sorry about that!

@ghost
Copy link
Author

ghost commented Jan 14, 2016

Oh man, if this works you'll be on my Christmas list for 10 years!

@Mottie
Copy link
Owner

Mottie commented Jan 14, 2016

LOL, send me lots of virtual chocolate-chip cookies 😉

@JamoCA
Copy link

JamoCA commented Jan 14, 2016

Thanks! I've just confirmed that the input parser update works and doesn't rewrite the checked checkbox values to "true".

@ghost
Copy link
Author

ghost commented Jan 14, 2016

Confirmed here, too... thanks Rob!

@ghost
Copy link
Author

ghost commented Aug 22, 2016

Both of those parsers are failing.

@Mottie
Copy link
Owner

Mottie commented Aug 23, 2016

Both of those parsers are failing.

Both? That file has six parsers:

  • inputs
  • inputs-numeric
  • checkbox
  • select
  • select-text
  • textarea

I know the one you're having issues with is the checkbox parser, what other parser is failing? And can we please keep the comments in issue #1090? Jumping to other issues is a pain because I have to read the entire thread to figure out the differences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants