# Correct data field after submission \[RESOLVED\]

**URL:** <https://community.gravityforms.com/t/correct-data-field-after-submission-resolved/9319>\
**Category:** Get Help\
**Tags:** gform\_save\_field\_value\
**Created:** [May 21, 2021, 8:56am UTC](https://community.gravityforms.com/t/correct-data-field-after-submission-resolved/9319 "2021-05-21T08:56:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lau06](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@Lau06](https://community.gravityforms.com/u/Lau06)\
**Post date:** [May 21, 2021, 8:56am UTC](https://community.gravityforms.com/t/correct-data-field-after-submission-resolved/9319/1 "2021-05-21T08:56:40Z")

</div>

Hi Gravity Community,

I was wondering if there was a way to correct the data after form submission ?  
For example : One of my client wants to receive city name without hyphen, We use a google maps autocompletion plugin on this field and city names can have hyphens.

maybe using a function with “gform\_save\_field\_value” ?

i tried that :

add\_filter( ‘gform\_save\_field\_value\_1\_24’, ‘remove\_hyphen’, 10, 3 );  
function remove\_hyphen($value, $entry, $field, $form) {  
$new\_value = str\_replace(’-’, ’ ', $value);  
return $new\_value;  
}

but it crashes my form…

Thx a lot

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [May 21, 2021, 3:20pm UTC](https://community.gravityforms.com/t/correct-data-field-after-submission-resolved/9319/2 "2021-05-21T15:20:52Z")

</div>

This code should work. There were some fancy quotes in there, but I am not sure if that is the forum software correcting that, or if that was in your code. Please try this:

```auto
// applies to form 1, field 24
add_filter( 'gform_save_field_value_1_24', 'remove_hyphen', 10, 5 );
function remove_hyphen( $value, $lead, $field, $form, $input_id ) {
	// replace hyphens with spaces
	$new_value = str_replace( '-', ' ', $value );
	return $new_value;
}

```

---

<div class="post-metadata">

**Author:** ![Lau06](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@Lau06](https://community.gravityforms.com/u/Lau06)\
**Post date:** [May 21, 2021, 3:53pm UTC](https://community.gravityforms.com/t/correct-data-field-after-submission-resolved/9319/3 "2021-05-21T15:53:15Z")

</div>

Hi Chris,

Thank you, that was exactly the problem.  
Now it works like a charm.

Thx a lot !

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [May 21, 2021, 3:55pm UTC](https://community.gravityforms.com/t/correct-data-field-after-submission-resolved/9319/4 "2021-05-21T15:55:53Z")

</div>


