Force capitalization


Author
Message
20jkim2
20jkim2
New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)
Group: Forum Members
Posts: 2, Visits: 4
Hi,
I am using the textbox function and am trying to constrain the answers to be capitalized.
This is the current code, but I want to make it so that unless the answer (their first name) is capitalized, the participants cannot move on.
How would I make this happen?

<textbox name>
/ caption = "Please enter your first name.
Be mindful of capitalization."
/ txcolor = dimgray
/ position = (35%, 35%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 0)
/ textboxsize = (25,5)
</textbox>


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
20jkim2 - 6/27/2025
Hi,
I am using the textbox function and am trying to constrain the answers to be capitalized.
This is the current code, but I want to make it so that unless the answer (their first name) is capitalized, the participants cannot move on.
How would I make this happen?

<textbox name>
/ caption = "Please enter your first name.
Be mindful of capitalization."
/ txcolor = dimgray
/ position = (35%, 35%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 0)
/ textboxsize = (25,5)
</textbox>


You could write a regular expression to force capitalization and use that in /mask. However, the much friendlier way is to simply allow participants to enter their first name however they want and then apply normalization to the response (e.g. toLower() followed by capitalize()).
20jkim2
20jkim2
New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)
Group: Forum Members
Posts: 2, Visits: 4
Dave - 6/27/2025
20jkim2 - 6/27/2025
Hi,
I am using the textbox function and am trying to constrain the answers to be capitalized.
This is the current code, but I want to make it so that unless the answer (their first name) is capitalized, the participants cannot move on.
How would I make this happen?

<textbox name>
/ caption = "Please enter your first name.
Be mindful of capitalization."
/ txcolor = dimgray
/ position = (35%, 35%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 0)
/ textboxsize = (25,5)
</textbox>


You could write a regular expression to force capitalization and use that in /mask. However, the much friendlier way is to simply allow participants to enter their first name however they want and then apply normalization to the response (e.g. toLower() followed by capitalize()).

Sorry, I am a beginner to Inquisit, so I'm not sure how to do what you suggested. Could you tell me how to code it
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
20jkim2 - 6/27/2025
Dave - 6/27/2025
20jkim2 - 6/27/2025
Hi,
I am using the textbox function and am trying to constrain the answers to be capitalized.
This is the current code, but I want to make it so that unless the answer (their first name) is capitalized, the participants cannot move on.
How would I make this happen?

<textbox name>
/ caption = "Please enter your first name.
Be mindful of capitalization."
/ txcolor = dimgray
/ position = (35%, 35%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 0)
/ textboxsize = (25,5)
</textbox>


You could write a regular expression to force capitalization and use that in /mask. However, the much friendlier way is to simply allow participants to enter their first name however they want and then apply normalization to the response (e.g. toLower() followed by capitalize()).

Sorry, I am a beginner to Inquisit, so I'm not sure how to do what you suggested. Could you tell me how to code it
<block exampleBlock>
/ trials = [1=pageOne; 2=pageTwo]
</block>

<surveyPage pageOne>
/ questions = [1=name]
/ showPageNumbers = false
/ showQuestionNumbers = false
</surveypage>

<textbox name>
/ caption = "Please enter your first name."
/ txcolor = dimgray
/ position = (35%, 35%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 0)
/ textboxsize = (25,5)
</textbox>

<surveyPage pageTwo>
/ caption = "Raw input: <%textbox.name.response%>
Normalized: <%capitalize(toLower(textbox.name.response))%>"
/ showPageNumbers = false
/ showQuestionNumbers = false
</surveypage>


Given that you are new to working wiht Inquisit syntax, please work through the Programmer's Manual: https://www.millisecond.com/support/Inquisit%20Programmer's%20Manual.pdf

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
Dave - 6/27/2025
20jkim2 - 6/27/2025
Dave - 6/27/2025
20jkim2 - 6/27/2025
Hi,
I am using the textbox function and am trying to constrain the answers to be capitalized.
This is the current code, but I want to make it so that unless the answer (their first name) is capitalized, the participants cannot move on.
How would I make this happen?

<textbox name>
/ caption = "Please enter your first name.
Be mindful of capitalization."
/ txcolor = dimgray
/ position = (35%, 35%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 0)
/ textboxsize = (25,5)
</textbox>


You could write a regular expression to force capitalization and use that in /mask. However, the much friendlier way is to simply allow participants to enter their first name however they want and then apply normalization to the response (e.g. toLower() followed by capitalize()).

Sorry, I am a beginner to Inquisit, so I'm not sure how to do what you suggested. Could you tell me how to code it
<block exampleBlock>
/ trials = [1=pageOne; 2=pageTwo]
</block>

<surveyPage pageOne>
/ questions = [1=name]
/ showPageNumbers = false
/ showQuestionNumbers = false
</surveypage>

<textbox name>
/ caption = "Please enter your first name."
/ txcolor = dimgray
/ position = (35%, 35%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 0)
/ textboxsize = (25,5)
</textbox>

<surveyPage pageTwo>
/ caption = "Raw input: <%textbox.name.response%>
Normalized: <%capitalize(toLower(textbox.name.response))%>"
/ showPageNumbers = false
/ showQuestionNumbers = false
</surveypage>


Given that you are new to working wiht Inquisit syntax, please work through the Programmer's Manual: https://www.millisecond.com/support/Inquisit%20Programmer's%20Manual.pdf

And if you prefer to force the first letter to be entered capitalized instead of doing normalization after the fact, you can do:

<textbox name>
/ caption = "Please enter your first name."
/ mask = ^[A-Z].*
/ txcolor = dimgray
/ position = (35%, 35%)
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 0)
/ textboxsize = (25,5)
</textbox>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search