Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Required Field . . . How to?

There is incorrect line if (username '' email != '' || pass != ''). Here is a correct if (inputpass == '' && inputuser == '' &&inputemail == '') - just change the values names

Kevin
Posts: 0
Joined: Sun Oct 07, 2012 7:58 pm

Required Field . . . How to?

Hi Clinton,

Your code looks incomplete:
This is the complete code that has worked for me:

precode

function checkInputs(){
var field1 = Tiggr('field1name').val();
var field2 = Tiggr('field2name').val();
var field3 = Tiggr('field3name').val();
var field4 = Tiggr('field4name').val();
var button = Tiggr('buttonname');

if (field1 == '' field2 == '' field3 == '' || field4 == '') {
button.addClass('ui-disabled');
}

else {
button.removeClass('ui-disabled');
}}

checkInputs()

/code/pre

Place the above code on every input field (on value change custom JS) that you want the user to fill before the button becomes enabled.

Clinton
Posts: 0
Joined: Thu Oct 18, 2012 11:03 am

Required Field . . . How to?

Sorry. Like I mention in my comments above I didn't realize my operators were a mess. It did work, here was my complete code in the end

var username = Tiggr('txtRegUsername').val();
var email = Tiggr('txtRegEmail').val();
var pass = Tiggr('txtRegPass').val();
var cpass = Tiggr('txtRegConfirmPass').val();
var button = Tiggr('btnReg');

if (username == '' email == '' pass == '' || pass != cpass){
button.addClass('ui-disabled');
}
else {
button.removeClass('ui-disabled');
}

George Van Wormer5962866
Posts: 0
Joined: Mon Jun 17, 2013 9:40 pm

Required Field . . . How to?

Do you have to do anything to get the button enabled again or should the java handle that?

var button = Tiggr('Submiteventbutton');
button.addClass('ui-disabled');

Something to counter that at load?

Also, is field1 referring to the name under the common tab?

This is how my code looks:

function checkInputs() {
var eventnameInput = Tiggr('eventnameInput').val();
var eventStartDateInput = Tiggr('eventStartDateInput').val();
var intervalSelector = Tiggr('intervalSelector').val();
var Submiteventbutton = Tiggr('Submiteventbutton');
if (eventnameInput == '' eventStartDateInput == '' intervalSelector == '') {
button.addClass('ui-disabled');
}
else {
button.removeClass('ui-disabled');
}}
chechInputs()

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Required Field . . . How to?

Hello! Your code looks correct. Do you have any problem with that? Could you clarify your question please?

George Van Wormer5962866
Posts: 0
Joined: Mon Jun 17, 2013 9:40 pm

Required Field . . . How to?

The page loads correctly but after I enter the info into the required fields inputs, the submit button doesn't enable. Could it be because one of the required fields is a date/time?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Required Field . . . How to?

Where else you call the function except page load?

George Van Wormer5962866
Posts: 0
Joined: Mon Jun 17, 2013 9:40 pm

Required Field . . . How to?

See below

George Van Wormer5962866
Posts: 0
Joined: Mon Jun 17, 2013 9:40 pm

Required Field . . . How to?

These are all the events happening on this page.

Image

Image

After the information is created, it is stored in the appery database and sent to an outside service. Event info is then displayed the dashboard screen from a read service (pulled from appery database).

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Required Field . . . How to?

Looks like you have errors in code...
1) code var Submiteventbutton = Tiggr('Submiteventbutton');/code then you do codebutton.addClass('ui-disabled');/code so your variable's referring to button Submiteventbutton, but you use button which is not defined
2) You have function checkInputs, but you call chechInputs (there is a typo).

Return to “Issues”