Re: Including the .js files
Re: Including the .js files
- Subject: Re: Including the .js files
- From: Ute Hoffmann <email@hidden>
- Date: Thu, 15 Jul 2004 10:02:01 +0200
Hi,
I have form validation working in serveral components and I usually
bind it to the form element with a return type. I have bindings of the
type:
Form3: WOForm {
name = "buyform";
onsubmit = "return test()";
multipleSubmit = true;
action = bestellungPruefen;
}
In the header I have a javascript, that contains the function test()
This function checks the form elements and returns true, if everything
is alright and false, if there are fields, which are not filled in
correctly. If it returns false the form is not submitted and thus the
same page stays in the browser and the specified action binding is
never called. If the javascript returns true, the action is called and
the next page is returned. The javascript contains a number of if
clauses, one for every fied that is to be validated and as soon as a
validation fails false is returned and javascript opens an alert window
telling the user what should be changed.
I'm not sure, whether your app really does not find the javascript or
whether your way to use the script is the real problem. Besides, if you
transmit a form, you cannot do this with a hyperlink binding. You need
either a submit button or an active image. Otherwise your form will
never get submitted.
Hope this helps,
Regards
Ute
Am Mittwoch, 14.07.04 um 21:48 Uhr schrieb Kranthi Sagar Borra:
> Hi all,
>
> My question is regarding the js files that I need to include in my
> component. I ahve done something like this.
>
> <script src="<WEBOBJECT NAME=ResourceURL1></WEBOBJECT>"></script>
>
> and defined
>
> ResourceURL1: WOResourceURL {
> filename = "validate.js";
> framework = "app";
> }
>
> But now I have a hyperlink to the next page. On clicking this my page
> needs to be validate. So for cross browszer compatibility I did
> something like this
>
> <li id="btnnext1" class="linkstyle_next1"
> onmouseover="this.className='hoverstyle_next1';"
> onmouseout="this.className='linkstyle_next1';"
> onclick="checkWholeForm();">
> <WEBOBJECT NAME="Hyperlink12">Next Step</WEBOBJECT>
>
> So on click of this "Next Step", javascript function,checkWholeForm
> that is defined in the .js file is executed which will check if the
> mandatory fileds are required.
>
> 1. But after validating the action method that is associated to the
> Hyperlink12 is getting executed, which I do not want to do.
> 2. Also to handle cross broser compatibility, I am providing all the
> steps in <li>, but is there any other way by which I can handle this.
> thank you.
>
> Regards,
> Kranthi Sagar.
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.