# Mechanize problem with weird field names that contain colons such as "\_ctl0:ContentPlaceHolder1:tbL

**URL:** <https://www.ruby-forum.com/t/mechanize-problem-with-weird-field-names-that-contain-colons-such-as-ctl0tbl/130548>\
**Category:** Rails\
**Created:** [February 29, 2008, 8:12am UTC](https://www.ruby-forum.com/t/mechanize-problem-with-weird-field-names-that-contain-colons-such-as-ctl0tbl/130548 "2008-02-29T08:12:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Virginian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/bc8723/32.png) [@Virginian](https://www.ruby-forum.com/u/Virginian)\
**Post date:** [February 29, 2008, 8:12am UTC](https://www.ruby-forum.com/t/mechanize-problem-with-weird-field-names-that-contain-colons-such-as-ctl0tbl/130548/1 "2008-02-29T08:12:55Z")

</div>

Ruby is blowing up on me when I use fieldnames with colons such as  
“\_ctl0:ContentPlaceHolder1:tbLastName”

you can irb session looks like: this which you can copy and paste to  
try it as the site is on the web.  
[http://pastie.caboo.se/159184](http://pastie.caboo.se/159184)

require ‘rubygems’  
require ‘mechanize’  
agent = WWW::Mechanize.new  
page = agent.get(‘[https://www.sss.gov/RegVer/wfVerification.aspx](https://www.sss.gov/RegVer/wfVerification.aspx)’)  
pp page

# from the output I see that the form name is {name “aspnetForm”}

sss\_form = page.form(‘aspnetForm’)

pp sss\_form

# I prints the form which I can see a few filed names including

# #\<WWW::Mechanize::Form::Field:0x110f224 @name=“InitialDay”,

@value=“29”\>

# and another one for this sample

# #\<WWW::Mechanize::Form::Field:0x110d348

@name=“\_ctl0:ContentPlaceHolder1:tbLastName”, value=“”\>

sss\_form.InitialDay = “1”

# =\> “1”

sss\_form.\_ctl0:ContentPlaceHolder1:tbLastName = ‘Smith’  
#SyntaxError: compile error  
#(irb):14: syntax error, unexpected ‘:’, expecting $end  
#sss\_form.\_ctl0:ContentPlaceHolder1:tbLastName = ‘Smith’

# ^

# from (irb):14

# from :

# 

# 

# and so it blows up

Any ideas?

Thanks in advance for your help.

Best Regards - Charles
