Hi all,
I have been trying to get my head around this for awhile now, but cant seem to work out this last little bit.
Let me explain what I'm doing.
I have an events page where someone can enrol for an event, when they click "Enrol" it takes them to a form which has been populated with things like the date, location, etc for the event. They can then enter missing details like their names, email address, etc.
I am using the following to achieve the above:
//Function for adding subject to subject box
if($('#Form_Form').length > 0){
var course = decodeURIComponent($.getUrlVar('cour'));
var date = decodeURIComponent($.getUrlVar('date'));
var time = decodeURIComponent($.getUrlVar('time'));
var loc = decodeURIComponent($.getUrlVar('loc'));
var price = decodeURIComponent($.getUrlVar('price'));
if(course != 'undefined'){
$('#EditableRadioField39').hide();
$('#Form_Form_EditableTextField40').val(course);
} else {
$('#EditableTextField40').hide();
}
if(date != 'undefined'){
$('#Form_Form_EditableDateField13').val(date);
}
if(time != 'undefined'){
$('#Form_Form_EditableTextField12').val(time);
}
if(loc != 'undefined'){
$('#Form_Form_EditableTextField14').val(loc);
}
if(price != 'undefined'){
$('#Form_Form_EditableTextField36').val(price);
}
}
The only issue I have is that I need to make something that changes the price dependent on how many people sign up for the event.
I cant seem to create a new function which works.
how can I work out if a EditableTextField has nothing assigned to it?
The following is what I am trying:
if($('#EditableTextField21').var != ''){
$('#Form_Form_EditableTextField36').val(price*2);
}
EditableTextField21 is a text field for the persons Name.
EditableTextField36 is a field for the price.