onclick

Passing PHP variable to onClick method

蹲街弑〆低调 提交于 2020-01-06 09:58:16
问题 I'm pulling some data from MySQL using PHP and need to pass an ID as a parameter to a onClick() method. while($row = mysql_fetch_array($result)) { echo '<a href=# onclick="showFilm('<?php echo $row['ID'] ?>')">' . $row['Title']; } I'm getting a syntax issue on the echo statement. What am I doing wrong? 回答1: Yes you're trying to open a php tag inside a line of php. Do this echo '<a href="#" onclick="showFilm(' . $row['ID'] .')">' . $row['Title'] . '</a>'; There's also a closing </a> you missed

Passing PHP variable to onClick method

瘦欲@ 提交于 2020-01-06 09:54:19
问题 I'm pulling some data from MySQL using PHP and need to pass an ID as a parameter to a onClick() method. while($row = mysql_fetch_array($result)) { echo '<a href=# onclick="showFilm('<?php echo $row['ID'] ?>')">' . $row['Title']; } I'm getting a syntax issue on the echo statement. What am I doing wrong? 回答1: Yes you're trying to open a php tag inside a line of php. Do this echo '<a href="#" onclick="showFilm(' . $row['ID'] .')">' . $row['Title'] . '</a>'; There's also a closing </a> you missed

javascript onclick to select item with asp.net ListView control

感情迁移 提交于 2020-01-06 07:11:50
问题 I'm trying to implement a onclick event to select an item in a asp:ListViewControl. <ItemTemplate> <tr runat="server" id="MemberRow" onclick='<%#ClientScript.GetPostBackClientHyperlink(LvMembers, string.Format("Select${0}", Container.DataItemIndex)) %>'> <td> <asp:Literal runat="server" ID="LtlMembershipNumber" Text='<%#Eval("MembershipNo") %>' /> </td> <td> <asp:Literal runat="server" ID="LtlName" Text='<%#Eval("FullName") %>' /> </td> <td> <asp:Literal runat="server" ID="LtlCompany" Text='<

Magento backend, capture onclick events on different elements

谁说胖子不能爱 提交于 2020-01-06 06:53:26
问题 I've a working backend module with various forms to manage several different tables. On one of the forms I have a radio button group ( radios element on Magento). Here is the code snippet for this radio group: //radio group $fieldset->addField('radio_group', 'radios', array( 'label' => Mage::helper('banners')->__('Select campaign type'), 'name' => 'title', 'onclick' => '', 'onchange' => '', 'value' => '1', 'values' => array( array('value'=>'1','label'=>'Imagen'), array('value'=>'2','label'=>

selenium python onclick() gives StaleElementReferenceException

你离开我真会死。 提交于 2020-01-06 06:08:25
问题 The developer changed the code to use an onclick() DOM element instead of an url. So Now I need to reload page all the time to prevent it from getting stale. How can I do this with a single find_elements_by_xpath ? I assume it is the document.*.submit() that needs the DOM? https://localhost:4778/ruleengine/AlarmTest?category=Alert#, text:(Force), onclick():document.Forceee0deabfba2341d2a0988779499f5530.submit() Old code now fails: driver.get(alarmurl) elems = driver.find_elements_by_xpath("/

Radio Button Onclick Event Requires Two Clicks to Fire/Execute on Firefox

天大地大妈咪最大 提交于 2020-01-06 05:37:15
问题 Hoping someone has a solution to this weirdness on Firefox 3. I basically have 3 radio buttons and 3 text input fields (see following code): <input type="radio" name="group1" id="preloaded" value="preloaded_img" checked="checked" onclick="SetVals();" /> <input type="text" name="text1" id="text1" /> <input type="radio" name="group1" id="custom" value="custom_img" onclick="SetVals();" /> <input type="text" name="text2" id="text2" /> <input type="radio" name="group1" id="vector" value="vector

Javascript: Dynamically set onclick event with different parameters

↘锁芯ラ 提交于 2020-01-06 05:27:44
问题 Trying to rewrite, with minimal functional changes, a program that was written 10+ years ago. Taking it from aspx pages to .NET Core 3.0. For the most part, everything is straight forward. But here's the one problem I'm having - mainly because I'm not great with Javascript (and my searching online has yet to reveal the solution). In the old system, to search for names, here was the process: Click a letter. Letter 'link' calls back to code behind. Code behind appends the new letter to a search

Angular on click event for multiple items

陌路散爱 提交于 2020-01-06 05:08:11
问题 What I am trying to do: I am trying to have collapsible accordion style items on a page which will expand and collapse on a click event. They will expand when a certain class is added collapsible-panel--expanded . How I am trying to achieve it: On each of the items I have set a click event like so: <div (click)="toggleClass()" [class.collapsible-panel--expanded]="expanded" class="collapsible-panel" *ngFor="let category of categories"> .... </div> <div (click)="toggleClass()" [class

Simple JavaScript OnClick Function

允我心安 提交于 2020-01-06 04:53:26
问题 I'm finally getting round to creating a website for my print design portfolio. I know exactly what I'm trying to achieve but being fairly new to web design I have found some limitations with the knowledge I have.... I have used css3 transitions (currently they only work in Chrome and Safari) to make flip cards which are triggered on hover - these work perfectly and are exactly what I am looking for. All I am now trying to do is add an JavaScript function (using jQuery) that permanently flips

How to get a click event for each li, not all

柔情痞子 提交于 2020-01-06 04:30:10
问题 im trying to get this button to show a hidden div onClick within each li that will show over the post div in an absolute positioning. The problem is, on click, it's showing all of the hidden div's for all li's. Im using wordpress + buddypress, so each li's id has a unique ID <li id="activity-<?php bp_activity_id(); ?>" class="activity" > <div id="post"></div> <div class="action"> //my pop in stuff </div> <div id="post-actions-bar"> <button id="show">show</button> </div> </li> and here's my