1
coops
Form values
  • 2005/8/26 9:28

  • coops

  • Just popping in

  • Posts: 82

  • Since: 2005/6/15


You know how sometimes a website asks you to type in your email twice, and if they don't match you get a javascript alert?

Well I'm doing the opposite. There cannot be two of the same values in my form.

I have done the javacript for it, and thats all in place,
JAVASCRIPT
print " function BothFieldsIdenticalCaseSensitive() {n";
print 
"     var one = document.formulize.ELEMENTA.value.toLowerCase();n";
print 
"     var another = document.formulize.ELEMENTB.value.toLowerCase();n";
print 
"     if(one == another) {n";
print 
"        alert("Oops You selected the same option twiceCan you please change it before submitting?");n";
print 
"        return false;n";
print 
"     } else {n";
print 
"        return true;";
print 
"     };n";
print 
" }n";
print 
"-->n";
print 
"</script>n";


I have also called the function in the right spot (im sure):

$saveButton->setExtra("onclick=javascript:return BothFieldsIdenticalCaseSensitive();");


Now, here is the problem
If I have 10 different form fields, how can I make sure that none match?

Also, I have caled them ELEMENTA and ELEMENTB as an example, but cannot find the real variable in the file.

I am using Formulize

Please help!

2
coops
Re: Form values
  • 2005/8/26 23:20

  • coops

  • Just popping in

  • Posts: 82

  • Since: 2005/6/15


Bump! please help!

3
ralf57
Re: Form values
  • 2005/8/27 0:30

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


This is a JS issue.
Try searching javascript forums at
http://www.tek-tips.com/
or
http://www.sitepoint.com/forums/forumdisplay.php?f=15
I'm pretty sure you will find the answer.
ATB,ralf
Don't know what i want but i know how to get it..........

4
coops
Re: Form values
  • 2005/8/27 0:58

  • coops

  • Just popping in

  • Posts: 82

  • Since: 2005/6/15


Hi,

It's not really a javascript issue because I have the javascript working fine in an html file.

It's the php, more specifically the variables used within Formulize module.

I need to figure out how to call the name of each field produced by the form, so that ELEMENTA becomes "prefrence_1" or whatever the field may be depending on the form.

Anybody?

5
jegelstaff
Re: Form values

I have made a posting about this in the dev.xoops.org area for Formulize:

http://dev.xoops.org/modules/xfmod/forum/forum.php?thread_id=1843&forum_id=745

--Julian
Technical Architect - Freeform Solutions
Formulize - custom registration forms, ad hoc forms and reports

Login

Who's Online

242 user(s) are online (151 user(s) are browsing Support Forums)


Members: 0


Guests: 242


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits