| View previous topic :: View next topic |
| Author |
Message |
Matt.Berther
Joined: 28 Sep 2006 Posts: 13
|
Posted: Wed Mar 21, 2007 10:27 pm Post subject: Problems using Validation as per Hammett's camtasia example |
|
|
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 |
|
 |
hammett Castle Team

Joined: 15 Apr 2006 Posts: 1739 Location: SP, Brasil
|
|
| Back to top |
|
 |
Ayende Rahien Castle Team
Joined: 28 Apr 2006 Posts: 573 Location: Israel
|
Posted: Thu Mar 22, 2007 3:15 am Post subject: |
|
|
| Also, enable JS debug and try to track down the failing javascript |
|
| Back to top |
|
 |
Matt.Berther
Joined: 28 Sep 2006 Posts: 13
|
Posted: Thu Mar 22, 2007 3:18 am Post subject: |
|
|
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 |
|
 |
Matt.Berther
Joined: 28 Sep 2006 Posts: 13
|
Posted: Thu Mar 22, 2007 3:25 am Post subject: |
|
|
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 |
|
 |
hammett Castle Team

Joined: 15 Apr 2006 Posts: 1739 Location: SP, Brasil
|
Posted: Thu Mar 22, 2007 11:49 am Post subject: |
|
|
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 |
|
 |
Matt.Berther
Joined: 28 Sep 2006 Posts: 13
|
Posted: Thu Mar 22, 2007 2:01 pm Post subject: |
|
|
Hammett: Im using the latest in SVN. I pulled the code yesterday and built. _________________ --
Matt Berther
http://www.mattberther.com |
|
| Back to top |
|
 |
Matt.Berther
Joined: 28 Sep 2006 Posts: 13
|
Posted: Thu Mar 22, 2007 7:30 pm Post subject: |
|
|
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 |
|
 |
Mike343
Joined: 29 Aug 2006 Posts: 19
|
Posted: Fri Mar 23, 2007 10:57 am Post subject: |
|
|
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  |
|
| Back to top |
|
 |
|