Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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)')) ) );


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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://575517]
[marto]: holli perfect
[ambrus]: Corion: four days a week? hmm
[Corion]: ambrus: I did that in 2012 and 2013, to try it out, and I found the available time to be worth more to me than the money
[Corion]: I've started that again this month (now forever instead of a limited time), and it already destresses me a lot
[holli]: There are Anti Vaxxer weeks at IKEA.
[Corion]: Of course, it's a 20% cut in the money I receive, while the work doesn't necessarily reduce at all, but my approach is to make the work take longer instead of fitting 5 days worth of work into 4
[holli]: 50% off all children coffins.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2017-09-21 15:04 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (249 votes). Check out past polls.