HTML选项选择第一个默认值而不是选择值

时间:2017-05-18 19:59:59

标签: php html

每当我在下拉列表中选择任何其他选项时,我仍然会得到第一个值为'?'而不是我选择的任何其他。

FLOW = OAuth2WebServerFlow(
        client_id=client id,
        client_secret=secret,
        scope=scope,
        user_agent=user_agent,redirect_uri=redirect_uri)

auth_uri = FLOW.step1_get_authorize_url()



credentials=FLOW.step2_exchange(code)


people_service = apiclient.discovery.build('people', 'v1',credentials=credentials)
connections = people_service.people().connections().list(resourceName='people/me').execute()

我错过了什么?

2 个答案:

答案 0 :(得分:0)

我犯了一个错误 我没有得到任何其他值的原因是因为我获得了第一个选项的ID,所以每次都会检索相同的值

我通过将Id的值移动到第一个选择标记

来解决它

答案 1 :(得分:0)

我最好的猜测是,无论DOM元素id role option,您都可以获得价值。在这种情况下,您已经定义了始终拥有id role的{​​{1}}。

相关问题