Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: JScript and Perl

by gellyfish (Monsignor)
on Sep 29, 2006 at 12:27 UTC ( #575517=note: print w/replies, xml ) Need Help??


in reply to JScript and Perl

You've got the quoting wrong in the

print table({-width=>'97%',-cellpadding=>4,-cellspacing=>5}, Tr({-align=>RIGHT,-valign=>TOP}, td( submit(-name=>'Update',-value=>'Update',-onClick(Validat +eForm(this.form)))) ) );
I think you want something like:
print table({-width=>'97%',-cellpadding=>4,-cellspacing=>5}, Tr({-align=>RIGHT,-valign=>TOP}, td( submit(-name=>'Update',-value=>'Update',-onClick => 'Val +idateForm(this.form)')) ) );

/J\

Replies are listed 'Best First'.
Re^2: JScript and Perl
by Anonymous Monk on Sep 29, 2006 at 13:31 UTC
    Thanks. I have corrected the mistakes and able to compile. But I it is working ie. does not call that function (ValidateForm). No alert message is coming. This is the part of the JScript.
    function ValidateForm(){ var Phone=document.inFOrm.Mobile alert("In JS") if ((Phone.value==null)||(Phone.value=="")){ alert("Please Enter your Phone Number") Phone.focus() return false } }
      Now we're into the world of some other language. In your browser turn on the javascript console (in Mozilla you just type javascript: into the location bar not sure how to do it in IE). You need to find out what kind of error happens when you click on the Submit button. I suspect since your calling ValidateForm(this.form) when you click the button, your function should be modified to use the passed variable...
      function ValidateForm(foo){ alert("In JS"); if ((foo.Mobile.value==null)||(foo.Mobile.value=="")){ alert("Please Enter your Phone Number"); foo.Mobile.focus(); return false; } }
      Also in your code I supsect inFOrm should be inForm which might just fix your problem without rewritting the function like I just did.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://575517]
help
Chatterbox?
[Lady_Aleena]: Renaming things like get_THAC0 to just THAC0 was easy. These are harder.
[james28909]: consolidate the three subs into one
[Lady_Aleena]: Um, what?
[james28909]: check is is data or hash or array and do tasks then return needed data
[Lady_Aleena]: james28909, you might want to look at the other two on my scratchpad.
[james28909]: after you send to a sub, you can check if it is array or ref ect with ref

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2017-05-24 04:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?