2 of 2
2
Dynamic Title and URL Title
Posted: 10 November 2010 04:21 AM   [ Ignore ]   [ # 16 ]
Has a Great Personality
Rank
Total Posts:  41
Joined  2010-11-08

And this is the iframe

<!DOCTYPE html>
<
html lang="en">
<
head>
    <
meta charset="utf-8"/>
    <
title>Publish Fixtures NIFootball</title>
    <
style type="text/css">
    
tabletrtd{
        margin
0;
        
padding0;
        
border0;
        
outline0;
        
font-size100%;
        
vertical-alignbaseline;
        
backgroundtransparent;
        
border-collapsecollapse;
        
border-spacing0;
    
}
    td{
        padding
5px 0;
    
}
    fieldset{
        background
-color#f7f7f7;
        
border1px solid #ccc;
        
margin0;
        
padding5px 10px;
    
}
    
</style>

[removed]
$(document).ready(function(){
    
$('#publishForm').submit(function(){
        
$('input[name=title]').val( $('select[name=fixture_home_team] option:selected').text() + ' ' + $('select[name=fixture_away_team] option:selected').text() );
    
});
});
[removed]

</head>
<
body>

<
form id="publishForm" method="post" action="http://localhost/www.nifootball.co.uk/index.php/fixtures/publish_row_league"  enctype="multipart/form-data" >
<
div class='hiddenFields'>
<
input type="hidden" name="ACT" value="34" />
<
input type="hidden" name="RET" value="http://localhost/www.nifootball.co.uk/index.php/fixtures/publish_row_league" />
<
input type="hidden" name="URI" value="fixtures/publish_row_league" />
<
input type="hidden" name="XID" value="218313a7b59d754c4d165c1536dcfe43c4a91741" />
<
input type="hidden" name="return_url" value="fixtures/thanks_row" />
<
input type="hidden" name="author_id" value="1" />
<
input type="hidden" name="channel_id" value="13" />
<
input type="hidden" name="site_id" value="1" />
<
input type="hidden" name="return" value="fixtures/thanks_row" />
</
div>


<
fieldset>
<
input type="hidden" name="allow_comments" value="n" />

<
input type="hidden" name="status" value="Pending" />

<
table cellspacing="0">
    <
tr>
        <
td>
            <
input type="text" name="entry_date" id="entry_date" value="2010-11-09 23:15" maxlength="23" size="16" />
            <
input type="hidden" name="title"  id="title" value="e.g. Abbey Villa v Malachians" />
            <
select name="category[]">
                <
option value="" selected="selected">--</option>
                
                <
optgroup label="Northern Amateur Football League">

                                </
optgroup>
                                
                <
option value="13">Premier Division
                                
</option>
                                
                <
option value="14">Division 1A
                                
</option>
                                
                <
option value="17">Division 1B
                                
</option>
                                
                <
option value="18">Division 1C
                                
</option>
                                
                <
option value="19">Division 2A
                                
</option>
                        
            </
select>
        </
td>
    </
tr>
    <
tr>
        <
td>
            <
select name="fixture_home_team">
<
option value="" selected="selected">--</option>
<
option value="952">100th OB</option>
<
option value="2658">10th OB</option>

</
select> @ <select name="fixture_away_team">

<
option value="" selected="selected">--</option>
<
option value="952">100th OB</option>
<
option value="2658">10th OB</option>
<
option value="1420">112th OB</option>
<
option value="1421">112th Scouts OB</option>
<
option value="953">118th OB</option>
<
option value="776">14th Newtownabbey OB</option>

</
select
            <
button type="submit" name="submit">Submit</button>
        </
td>
    </
tr>

</
table>
</
fieldset>
</
form>[removed]// <![CDATA[ 
if (typeof EE == "undefined" || ! EE{
var EE {"BASE":"http://localhost/www.nifootball.co.uk/index.php?","THEME_URL":"http://www.nifootball.co.uk/themes/cp_themes/default/","PATH_CP_GBL_IMG":"http://www.nifootball.co.uk/themes/cp_global_images/","filebrowser":{"endpoint_url":"ACT=6","window_title":"File Manager","theme_url":"http://www.nifootball.co.uk/themes/cp_themes/default/"},"lang":{"or":"or","resize_image":"Resize Image","return_to_publish":"Return to Publish","confirm_exit":"When you leave, any data entered will be lost. Are you sure you want to leave?","add_new_html_button":"Add New HTML button"},"publish":{"show_write_mode":true,"title_focus":true,"smileys":true},"user_id":"1"};}
mySettings 
{"nameSpace":"html","onShiftEnter":{"keepDefault":false,"replaceWith":"<br />\n"},"onCtrlEnter":{"keepDefault":false,"openWith":"\n<p>","closeWith":"</p>\n"},"markupSet":[{"name":"b","key":"B","openWith":"<strong>","closeWith":"</strong>","className":"btn_b"},{"name":"i","key":"I","openWith":"<em>","closeWith":"</em>","className":"btn_i"},{"name":"blockquote","key":"Q","openWith":"<blockquote>","closeWith":"</blockquote>","className":"btn_blockquote"},{"name":"a","key":"A","openWith":"<a >","closeWith":"</a>","className":"btn_a"},{"name":"img","key":"","replaceWith":"","className":"btn_img"}]};
myWritemodeSettings {"nameSpace":"html","onShiftEnter":{"keepDefault":false,"replaceWith":"<br />\n"},"onCtrlEnter":{"keepDefault":false,"openWith":"\n<p>","closeWith":"</p>\n"},"markupSet":[{"name":"b","key":"B","openWith":"<strong>","closeWith":"</strong>","className":"btn_b"},{"name":"i","key":"I","openWith":"<em>","closeWith":"</em>","className":"btn_i"},{"name":"blockquote","key":"Q","openWith":"<blockquote>","closeWith":"</blockquote>","className":"btn_blockquote"},{"name":"a","key":"A","openWith":"<a >","closeWith":"</a>","className":"btn_a"},{"name":"img","key":"","replaceWith":"","className":"btn_img"}],"onTab":{"keepDefault":false,"replaceWith":"\t"}};

 
// ]]>
[removed][removed][removed][removed]
// <![CDATA[
$(document).ready(function() {
    
            
if (typeof SafeCracker == "undefined" || ! SafeCracker{
                
var SafeCracker {markItUpFields:{}};
            
}
        
    
$.each(SafeCracker.markItUpFields,function(a){$("#"+a).markItUp(mySettings);});});
// ]]>
[removed]


</body>
</
html
Profile
 
 
Posted: 10 November 2010 04:21 AM   [ Ignore ]   [ # 17 ]
Has a Great Personality
Rank
Total Posts:  41
Joined  2010-11-08

Apologies for not knowing this and embarrassed for asking but how do I check the console for errors.

Profile
 
 
Posted: 10 November 2010 04:24 AM   [ Ignore ]   [ # 18 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29
stb74 - 10 November 2010 04:21 AM

Apologies for not knowing this and embarrassed for asking but how do I check the console for errors.

Depends on your browser. If Firefox, you’d have to use firebug. If Chrome, View > Developer > javascript console. In Safari, first go to Prefs > Advanced and show the developer toolbar. Then Develop > Show Error Console.

Profile
 
 
Posted: 10 November 2010 04:25 AM   [ Ignore ]   [ # 19 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

I’ve never tried using this in an iframe like that. It looks like you don’t have jQuery loaded in your iframe. You should add that to your head.

{exp:jquery:script_tag} 
Profile
 
 
Posted: 10 November 2010 04:26 AM   [ Ignore ]   [ # 20 ]
Has a Great Personality
Rank
Total Posts:  41
Joined  2010-11-08
Rob Sanchez - 10 November 2010 04:24 AM
stb74 - 10 November 2010 04:21 AM

Apologies for not knowing this and embarrassed for asking but how do I check the console for errors.

Depends on your browser. If Firefox, you’d have to use firebug. If Chrome, View > Developer > javascript console. In Safari, first go to Prefs > Advanced and show the developer toolbar. Then Develop > Show Error Console.

In the habit of posting and then doh! it hits me. From what I can tell there are no errors.

Profile
 
 
Posted: 10 November 2010 04:31 AM   [ Ignore ]   [ # 21 ]
Has a Great Personality
Rank
Total Posts:  41
Joined  2010-11-08
Rob Sanchez - 10 November 2010 04:25 AM

I’ve never tried using this in an iframe like that. It looks like you don’t have jQuery loaded in your iframe. You should add that to your head.

{exp:jquery:script_tag} 

Feel like such a plonker that was the problem.

Is it possible to have some other text in the jquery so I can have

fixture_home_team v fixture_away_team

Profile
 
 
Posted: 10 November 2010 04:32 AM   [ Ignore ]   [ # 22 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Sure, you can just change this part here:

$(document).ready(function(){
    
$('#publishForm').submit(function(){
        
$('input[name=title]').val( $('select[name=fixture_home_team] option:selected').text() + ' v ' + $('select[name=fixture_away_team] option:selected').text() );
    
});
}); 
Profile
 
 
Posted: 10 November 2010 04:36 AM   [ Ignore ]   [ # 23 ]
Has a Great Personality
Rank
Total Posts:  41
Joined  2010-11-08
Rob Sanchez - 10 November 2010 04:32 AM

Sure, you can just change this part here:

$(document).ready(function(){
    
$('#publishForm').submit(function(){
        
$('input[name=title]').val( $('select[name=fixture_home_team] option:selected').text() + ' v ' + $('select[name=fixture_away_team] option:selected').text() );
    
});
}); 

Many thanks that’s it sorted, thats going to save me so much time.

I will probably be back on again but haven’t got that far yet, can I do the same thing on an edit form.

Profile
 
 
   
2 of 2
2