• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 195

Backtrace:

File: /home/u125378470/domains/lawhelpguru.org/public_html/application/views/question.php
Line: 195
Function: _error_handler

File: /home/u125378470/domains/lawhelpguru.org/public_html/application/controllers/Questions.php
Line: 416
Function: view

File: /home/u125378470/domains/lawhelpguru.org/public_html/index.php
Line: 315
Function: require_once

I have two dropdowns created using HTML helpers, however i am not entirely sure on where i could add additional attributes to these two helpers? More specifically, i want to add an "onblur" attribute that calls a javascript function, as follows:

@onblur = "validate3(1)"

I want to be able to give the following HTML Helper dropdowns the above attribute:

@Html.DropDownList("ExpMonth", new List
                                {
                                    new SelectListItem { Text = "01", Value = "1"},
                                    new SelectListItem { Text = "02", Value = "2"},
                                    new SelectListItem { Text = "03", Value = "3"},
                                    new SelectListItem { Text = "04", Value = "4"},
                                    new SelectListItem { Text = "05", Value = "5"},
                                    new SelectListItem { Text = "06", Value = "6"},
                                    new SelectListItem { Text = "07", Value = "7"},
                                    new SelectListItem { Text = "08", Value = "8"},
                                    new SelectListItem { Text = "09", Value = "9"},
                                    new SelectListItem { Text = "10", Value = "10"},
                                    new SelectListItem { Text = "11", Value = "11"},
                                    new SelectListItem { Text = "12", Value = "12"}
                                }, "MM")

                                @Html.DropDownList("ExpYear", new List
                                {
                                    new SelectListItem { Text = "2020", Value = "1"},
                                    new SelectListItem { Text = "2021", Value = "2"},
                                    new SelectListItem { Text = "2022", Value = "3"},
                                    new SelectListItem { Text = "2023", Value = "4"},
                                    new SelectListItem { Text = "2024", Value = "5"},
                                    new SelectListItem { Text = "2025", Value = "6"},
                                    new SelectListItem { Text = "2026", Value = "7"},
                                    new SelectListItem { Text = "2027", Value = "8"},
                                    new SelectListItem { Text = "2028", Value = "9"},
                                    new SelectListItem { Text = "2029", Value = "10"},
                                    new SelectListItem { Text = "2030", Value = "11"},
                                }, "YY")

Any help is appreciated.