Add dash in field name? (for URL Parameter)

#1

Hello,

How to modify the name of a field name, by adding a character that is not allowed by Unbounce? I absolutely need to use a dash “-” in the name of my parameter to pre-fill a form (on another page), like “zip-code” (to use as URL parameter)

I haven’t found any solutions that work.

I tried this but didn’t work (or something is missing…):

$('#zipcode').attr('name', 'zip-code');

Source here: Dash in Field Label being removed

(it’s for a radio field, if it changes something)

Thanks! :slight_smile:

#2

Hi @jenn welcome to the Unbounce Community!

So, is the solution in that thread you sourced not working?

#3

Still… i’m also getting the same error?

#4

Hi @Kyle.C

Thanks! :slight_smile:

Nope, this solution didn’t work in my case. In the meantime, I have done differently. But I couldn’t find a solution that works to change the name of the parameter in the URL.

#5

Found the issue, some typographical errors in the script. The one I have included below works :slight_smile:

<script>
$('#returl').attr('name', 'retURL');
$('#zipcode').attr('name', 'zip-code');
</script> 

Enjoy and happy unbouncing!

1 Like