I am having so much trouble over something that should be real simple. Can anyone help me as to what I am doing wrong?
Error Message
Javascript Code
Form code:
Error Message
Message: 'document.ChronoContact_junk.totalcost' is null or not an object
Line: 128
Char: 1
Code: 0
URI: http://www.threegatesfestival.org/index.php?option=com_chronocontact&chronoformname=junk
Javascript Code
function updatesum()
{
var c = 5;
document.ChronoContact_junk.totalcost.value = c;
}
Form code:
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Name</label>
<input class="cf_inputbox" maxlength="150" size="30" title="" id="text_0" name="name1" type="text" onChange="updatesum()"/>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Age</label>
<select class="cf_inputbox" id="select_1" size="1" title="" name="age1" onChange="updatesum()">
<option value="0">Choose Option</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Name</label>
<input class="cf_inputbox" maxlength="150" size="30" title="" id="text_2" name="name2" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Age</label>
<select class="cf_inputbox" id="select_3" size="1" title="" name="age2" onChange="updatesum()">
<option value="0">Choose Option</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Total Cost</label>
<input class="cf_inputbox" maxlength="150" size="30" title="" id="text_4" name="totalcost" type="text" />
</div>
<div class="cfclear"> </div>
</div>
Hi juzwant2play,
There is no element with an id of 'totalcost'
Bob
There is no element with an id of 'totalcost'
. . . id="text_4" name="totalcost" . . .
Bob
Thanks for the reply. I am still getting the same error after adding the id tag.
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Name</label>
<input class="cf_inputbox" maxlength="150" size="30" title="" id="text_0" name="name1" type="text" onChange="updatesum()" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Total Cost</label>
<input class="cf_inputbox" maxlength="150" size="30" title="" id="totalcost" name="totalcost" type="text" />
</div>
<div class="cfclear"> </div>
</div>
function updatesum()
{
var c = 5;
document.ChronoContact_junk.totalcost.value = c;
}
Hi juzwant2play,
I think this is because you have the form twice in the page so the id isn't unique.
Bob
I think this is because you have the form twice in the page so the id isn't unique.
Bob
The form is only once on the page and the id is definitely unique. I copied the form code and javqascript code directly from the appropriate sections in chronoforms.
This topic is locked and no more replies can be posted.