Home

Castle Stronghold

Castle Project Forum Index Castle Project
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problems using Validation as per Hammett's camtasia example

 
Post new topic   Reply to topic    Castle Project Forum Index -> MR Usage
View previous topic :: View next topic  
Author Message
Matt.Berther



Joined: 28 Sep 2006
Posts: 13

PostPosted: Wed Mar 21, 2007 10:27 pm    Post subject: Problems using Validation as per Hammett's camtasia example Reply with quote

I recently watched Hammett's validation example available at:

http://hammett.castleproject.org/wp-content/uploads/2007/01/mr%20formvalidation.html

I've followed the exact steps in a similar project, and for the life of me cannot get this to work in IE7. Firefox works just fine, however, I do have a requirement to support IE.

The error that I get is:

Line: 1630
Char: 9
Error: Invalid source HTML for this operation

This is driving me absolutely mad, and any help would be much appreciated.
_________________
--
Matt Berther
http://www.mattberther.com
Back to top
View user's profile Send private message
hammett
Castle Team


Joined: 15 Apr 2006
Posts: 1739
Location: SP, Brasil

PostPosted: Thu Mar 22, 2007 3:09 am    Post subject: Reply with quote

can you paste the view and the html generated?
_________________
Cheers,
hammett
http://hammett.castleproject.org/
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Ayende Rahien
Castle Team


Joined: 28 Apr 2006
Posts: 573
Location: Israel

PostPosted: Thu Mar 22, 2007 3:15 am    Post subject: Reply with quote

Also, enable JS debug and try to track down the failing javascript
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Matt.Berther



Joined: 28 Sep 2006
Posts: 13

PostPosted: Thu Mar 22, 2007 3:18 am    Post subject: Reply with quote

Hammett: I will paste as soon as I get back to my windows box.

Ayende: JS Debug? How do you do that?
_________________
--
Matt Berther
http://www.mattberther.com
Back to top
View user's profile Send private message
Matt.Berther



Joined: 28 Sep 2006
Posts: 13

PostPosted: Thu Mar 22, 2007 3:25 am    Post subject: Reply with quote

Hammett:

The view is:

<html>
<head>
$Ajax.InstallScripts()
$Scriptaculous.InstallScripts()
</head>
<body>
$Form.FormTag("%{action='save'}")

#if ($Flash.summary)
<p>
#foreach($errmessage in $summary.ErrorMessages)
$errmessage <br />
#end
</p>
#end

<p>
$Form.LabelFor("link.name", "Caption:")
$Form.TextField("link.name")
</p>
<p>
$Form.LabelFor("link.target", "URL:")
$Form.TextField("link.target")
</p>

<p>
$Form.Submit("Save")
</p>

$Form.EndFormTag()
</body>
</html>



The generated HTML is:


<html>
<head>
<script type="text/javascript" src="/MonoRail/Files/AjaxScripts.aspx?RC3_0002"></script>
<script type="text/javascript" src="/MonoRail/Files/Effects2.aspx?RC3_0002"></script>
</head>
<body>
<form action='/Test/save.aspx' method='post' id='form1' >


<p>
<label for="link_name">Caption:</label>
<input type="text" id="link_name" name="link.name" value="" class="required" title="This is a required field" />
</p>
<p>
<label for="link_target">URL:</label>
<input type="text" id="link_target" name="link.target" value="" class="required" title="This is a required field" />
</p>

<p>
<input type="submit" value="Save" />
</p>


<script type="text/javascript">
new Validation('form1', {onSubmit:true, focusOnError:true, stopOnFirst:false, immediate:true, useTitles:true});</script>
</form>
</body>
</html>
_________________
--
Matt Berther
http://www.mattberther.com
Back to top
View user's profile Send private message
hammett
Castle Team


Joined: 15 Apr 2006
Posts: 1739
Location: SP, Brasil

PostPosted: Thu Mar 22, 2007 11:49 am    Post subject: Reply with quote

Seems that everything is fine. What version are you using? I never had problems with Prototype-Validation and IE7

What Ayende meant is to enable JS debug on IE and see what exactly is happening.
_________________
Cheers,
hammett
http://hammett.castleproject.org/
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Matt.Berther



Joined: 28 Sep 2006
Posts: 13

PostPosted: Thu Mar 22, 2007 2:01 pm    Post subject: Reply with quote

Hammett: Im using the latest in SVN. I pulled the code yesterday and built.
_________________
--
Matt Berther
http://www.mattberther.com
Back to top
View user's profile Send private message
Matt.Berther



Joined: 28 Sep 2006
Posts: 13

PostPosted: Thu Mar 22, 2007 7:30 pm    Post subject: Reply with quote

For what its worth, I seem to have figured out the problem...

Unlike Hammett's demo, with the version Im using, I am not able to wrap the input type in a <p> tag... It looks like I should be using <div> or something else.

Thanks for everyone thats looked at this.
_________________
--
Matt Berther
http://www.mattberther.com
Back to top
View user's profile Send private message
Mike343



Joined: 29 Aug 2006
Posts: 19

PostPosted: Fri Mar 23, 2007 10:57 am    Post subject: Reply with quote

ah yes I had the same problem and switched the <p> to <div> and everything worked as it should.

Really paragraphs/text should go inside <p> tags anyways since thats what there for Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Project Forum Index -> MR Usage All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group