Trying to duplicate a Form field without success

I’m using the phpMotion script and trying to add a 2nd “tag” field to the Upload Video Form. (The ‘tag’ field is for entering tags or search words, so the video can be found when searching).

    <li style="width:240px; text-align:right;"><strong>[var.lang_tags]:</strong></li>
    <li style="width:400px; text-align:left;"><input name="tags" type="text" class="upload-video-form-input" value="[var.tags]" size="38" />
    </li>

I copied and duplicated that code, like so:

<li style="width:240px; text-align:right;"><strong>[var.lang_tags]:</strong></li>
<li style="width:400px; text-align:left;"><input name="tags" type="text" class="upload-video-form-input" value="[var.tags]" size="38" />
</li>

<li style="width:240px; text-align:right;"><strong>[var.lang_tags]2:</strong></li>
<li style="width:400px; text-align:left;"><input name="tags" type="text" class="upload-video-form-input" value="[var.tags]" size="38" />
</li>

But upon submitting the Form, Tags2: (the duplicated line) was required to proceed, not the original Tag field.
Can you tell me what else I need to do to create a second (required) Tag field?

I don’t know phpMotion, but won’t the field name have to be different on the second tag? You’ve called them both “tags”.

Thanks for your reply.
I changed the input name to “tags2” like this:

<li style="width:240px; text-align:right;"><strong>[var.lang_tags]2:</strong></li>
<li style="width:400px; text-align:left;"><input name="tags2" type="text" class="upload-video-form-input" value="[var.tags]" size="38" />

Buy I can’t find what is entered into Tags2 field when searched. The mysql has a column named ‘tags’, so do you think I’d be on the right track if I added a column named ‘tags2’ in that db, and then add ‘tags2’ to this line in the search.php file:

$type_query_rows 	= 'indexer, video_id, title, title_seo, date_uploaded, user_id, video_length,  approved, public_private, description, tags, number_of_views';

I look forward to any guidance.
Much thanks

If I’ve understood correctly, you have added an extra field to the upload form - yes? I imagine you are also going to need to add that field to the part of the script that processes the upload.

Thanks for your reply.

Yes, you are correct, I added an extra field to the upload form.
Regarding, adding to the “part of the script that processes the upload”, I’ve added ‘tags2’ everywhere I see ‘tags’ in the uploader.php file like so:

// grab values from form if any
$form_submitted		= $_POST['form_submitted'];
$title 			= $_POST['title'];
$description 		= $_POST['description'];
$tags 			= $_POST['tags'];
$tags2 			= $_POST['tags2'];

and

foreach ($_POST as $key => $value) {
  	if ($key == 'title' || $key == 'description' || $key == 'tags' || $key == 'tags2' || $key == '$channel') {
        	if (!isset($value) || ($value == '')) {
            $display_key	= @str_replace('_', ' ', $key);
            $error_message	= $config['notification_error'];
            $blk_notification = 1;
            $error_message 	= $error_message . " - " . $display_key . "  - $lang_required ";
            		$procede 		= false;
        	}
    	}
	}

And added ‘tags2’ to this line in the search.php file like so:

$type_query_rows 	= 'indexer, video_id, title, title_seo, date_uploaded, user_id, video_length,  approved, public_private, description, tags, tags2, number_of_views';

Now do you think I need to add a ‘tags2’ column in the db where the column ‘tags’ is?

I look forward to any guidance.
Much thanks

Ah yes, you do.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.