Validation problem
Posted: 12 January 2011 06:54 AM   [ Ignore ]
Circled in the Yearbook
RankRankRank
Total Posts:  702
Joined  2010-04-08

Latest SC and EE

Got a problem with inline validation. 2 fields on a form and both required in the CP. If I fill either in and leave the other blank, when the form is redisplayed the earlier entered date is missing and an inline error messages is displayed for the field that was left empty.

I was expecting the data to be there when the form is re shown.

Any clues smile

{if error:title}
{error:title}
{/if}

{if error:postcode}
{error:postcode}
{/if}

Profile
 
 
Posted: 12 January 2011 06:57 AM   [ Ignore ]   [ # 1 ]
Circled in the Yearbook
RankRankRank
Total Posts:  702
Joined  2010-04-08

Interestingly, if I hit the browser back button I get the page with the data I entered!

Profile
 
 
Posted: 12 January 2011 07:04 AM   [ Ignore ]   [ # 2 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Let’s see some more of your template, at least the form inputs for the field in question.

Profile
 
 
Posted: 12 January 2011 07:13 AM   [ Ignore ]   [ # 3 ]
Circled in the Yearbook
RankRankRank
Total Posts:  702
Joined  2010-04-08

FYI: MSM site.

Profile
 
 
Posted: 12 January 2011 07:40 AM   [ Ignore ]   [ # 4 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Add value=”{your_field_name}” to your inputs:

<input type="text" id="postcode" name="postcode" value="{postcode}" maxlength="5" size="7" /> 
Profile
 
 
Posted: 12 January 2011 04:39 PM   [ Ignore ]   [ # 5 ]
Circled in the Yearbook
RankRankRank
Total Posts:  702
Joined  2010-04-08

Thanks. SC has changed my life smile

Profile
 
 
Posted: 12 January 2011 07:16 PM   [ Ignore ]   [ # 6 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Me too smile

Profile
 
 
Posted: 13 January 2011 06:19 AM   [ Ignore ]   [ # 7 ]
Circled in the Yearbook
RankRankRank
Total Posts:  702
Joined  2010-04-08

Sorry it’s me again.

I added value=â?{your_field_name}â? to all the input fields, but it turns out only the title field is keeping it’s data when the form is redisplayed. The other fields are blank.

I’ve stuck the form on pastebin at http://pastebin.com/HReJcXv9

Profile
 
 
Posted: 13 January 2011 06:48 AM   [ Ignore ]   [ # 8 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

I made some tweaks to the textareas and selects: http://pastebin.com/3pm8qWE4

So {postcode} isn’t keeping?

Any chance you can send me a login and let me see for myself?

Profile
 
 
Posted: 13 January 2011 07:04 AM   [ Ignore ]   [ # 9 ]
Circled in the Yearbook
RankRankRank
Total Posts:  702
Joined  2010-04-08

I copied the tweaks over, but no diffeence.

So {postcode} isnâ??t keeping?

No.

The site is a long term pet project, but you’re welcome to login an ferret around. You’ll need to go to the classifieds MSM, then the template group new. I’ll PM you the login.

Said page is: http://classifieds.listfrance.com/index.php/new/alsace/bas-rhin/for-sale-general/214

Profile
 
 
Posted: 30 March 2011 03:39 PM   [ Ignore ]   [ # 10 ]
Wallflower
Rank
Total Posts:  1
Joined  2011-03-30

Was any solution ever found to this problem?

I’m having the same problem with fields not repopulating, but only on new entries. As far as I can tell everything works when editing existing entries.

[ Edited: 30 March 2011 03:48 PM by David ]
Profile