Search Results

Search found 20513 results on 821 pages for 'form submit'.

Page 20/821 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • how to validate the form using jquery

    - by kumar
    I have this Fieldset values.. <fieldset class="clearfix" id="fieldset-exception"> <legend>Mass Edit Exception Information</legend> <div id="#error-msg-ID" class="ui-widget hide"> <div class="ui-state-highlight ui-corner-all"> <p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"></span> <span></span></p> </div> </div> <div class="fiveper"> <label for="ExceptionStatus"> Status: <span> </span> </label> <label for="ResolutionCode"> Resolution: <span> <%=Html.DropDownListFor(model => model.Exception.ResolutionCode, new SelectList(Model.LookupCodes["C_EXCPT_RESL"], "Key", "Value"))%> </span> </label> <label for="ReasonCode"> Reason: <span><%=Html.DropDownListFor(model => model.Exception.ReasonCode, new SelectList(Model.LookupCodes["C_EXCPT_RSN"], "Key", "Value"))%></span> </label> <label for="ExceptionStatus"> Action Taken: <span><%=Html.DropDownListFor(model => model.Exception.ActionCode, new SelectList(Model.LookupCodes["C_EXCPT_ACT"], "Key", "Value"))%></span> </label> </div> <div class="fiveper"> <label for="FollowupDate"> Follow-up: <span><input type="text" id="exc-flwup" name="fdate" /></span> <%--<%=Html.EditorFor(model=>model.Exception.FollowupDate) %>--%> </label> <label for="IOL"> Inquiry #: <%=Html.TextBox("Inquiry", ViewData["inq"] ?? "")%> </label> <label>Comment</label> <span> <%=Html.TextArea("value", ViewData["Comnt"] ?? "")%> <%=Html.ValidationMessage("value")%> </span> </div> <br /> <br /> <div> <input type="submit" class="button" value="Save" /> </div> </fieldset> before submiting I need to do some time of validation..below validation not working for me is that right what I am doing here? These all fieds user is entering from UI.. thanks <script type="text/javascript"> $(document).ready(function() { $('#btnSelectAll').click(function() { $('#EditExceptions input[name=chk]').attr('checked', true); }); $('#btnCancel').click(function() { $('#EditExceptions input[name=chk]').attr('checked',false); }); function validate_excpt(formData, jqForm, options) { var form = jqForm[0]; **if (form.e_Exception_ResolutionCode.value && !form.e_Exception_ReasonCode.value) { alert('All Resolution Codes need a Reason Code.'); return false; }** } // post-submit callback function showResponse(responseText, statusText, xhr, $form) { if (responseText[0].substring(0, 16) != "System.Exception") { $('#error-msg-ID span:last').html('<strong>Update successful.</strong>'); $().ShowDialog('Success', 'Update successful'); } else { $('#error-msg-ID span:last').html('<strong>Update failed.</strong> ' + responseText[0].substring(0, 48)); $().ShowDialog('Failed', 'Update failed'); } $('#error-msg-ID').removeClass('hide'); $('#gui-stat-').html(responseText[1]); } $('#exc-').ajaxForm({ beforeSubmit: validate_excpt, success: showResponse, dataType: 'json' }); $('.button').button(); $("input[id^='exc-flwup']").datepicker({ duration: '', showTime: true, constrainInput: true, stepMinutes: 30, stepHours: 1, altTimeField: '', time24h: true, minDate: 0 }); $('#ui-timepicker-div').bgiframe(); }); </script>

    Read the article

  • Open browser window with formed URL after posting a PHP form

    - by Gotjosh
    So here's the question. I have this php form that collects some data, after posting the data gets parsed an URL is constructed. After this URL is constructed, I'd like to open a new browser window for the user with this newly constructed URL. How can I actually accomplish this? Is this something that can only be done with javascript? If so... How? I already have the code in place and i've tested it works that construct the URL after posting the form, now it's just a matter of opening a new window with the URL.

    Read the article

  • CodeIgniter Form Validation

    - by mmcglynn
    I am trying to set up validation on a simple contact form that is created using the form helper. No validation at all occurs. What is wrong? In the code below, the “good” keyword always shows, regardless of what is entered into the form, and the saved values set via set_value are never shown. Controller // Contact function contact() { $data['pageTitle'] = "Contact"; $data['bodyId'] = "contact"; $this->load->library('form_validation'); $config_rules = array ('email' => 'required','message' => 'required'); $this->form_validation->set_rules($config_rules); if ($this->form_validation->run() == FALSE) { echo "bad"; $data['include'] = "v_contact"; $this->load->view('v_template',$data); } else { echo "good"; $data['include'] = "v_contact"; $this->load->view('v_template',$data); } } View echo validation_errors(); echo form_open('events/contact'); // name echo form_label('Name', 'name'); $data = array ( 'name' => 'name', 'id' => 'name', 'maxlength' => '64', 'size' => '40', 'value' => set_value('name') ); echo form_input($data) . "\n<br />"; // email address echo form_label('Email Address', 'email'); $data = array ( 'name' => 'email', 'id' => 'email', 'maxlength' => '64', 'size' => '40', 'value' => set_value('email') ); echo form_input($data) . "\n<br />"; // message echo form_label('Message', 'message'); $data = array ( 'name' => 'message', 'id' => 'message', 'rows' => '8', 'cols' => '35', 'value' => set_value('message') ); echo form_textarea($data) . "\n<br />"; echo form_submit('mysubmit', 'Send Message'); echo form_close();

    Read the article

  • ZF2 Vertical Form

    - by yunhasnawa
    I created a simple form in typical ZF2 application. The form class code is just a modified code provided by Zend's Album example. <?php namespace Admin\Form; use Zend\Form\Form; class CityForm extends Form { public function __construct($name = null) { parent::__construct('city'); $this->setAttribute('method', 'post'); $this->add(array( 'name' => 'id', 'attributes' => array( 'type' => 'hidden', ), )); $this->add(array( 'name' => 'name', 'attributes' => array( 'type' => 'text' ), 'options' => array( 'label' => 'Name', ), )); $this->add(array( 'name' => 'province', 'attributes' => array( 'type' => 'text' ), 'options' => array( 'label' => 'Province', ), )); $this->add(array( 'name' => 'country', 'attributes' => array( 'type' => 'text' ), 'options' => array( 'label' => 'Country', ), )); $this->add(array( 'name' => 'coordinate', 'attributes' => array( 'type' => 'text' ), 'options' => array( 'label' => 'Coordinate', ), )); $this->add(array( 'name' => 'submit', 'attributes' => array( 'type' => 'submit', 'value' => 'Save', 'id' => 'submitButton', ), )); } } And call it like this in CityController, a typical controller extends AbstractActionController: public function addAction() { $form = new CityForm(); $viewData = array( 'form' => $form ); return new ViewModel($viewData); } Finally in view I echo it like this: <?php $title = 'Add New City'; ?> <?php $this->headtitle($title); ?> <h1><?php echo $this->escapehtml($title); ?></h1> <?php $form = $this->form; ?> <?php $form->setAttribute('action', $this->url('city', array('action' => 'add'))); ?> <?php $form->prepare(); ?> <?php echo $this->form()->openTag($form); echo $this->formHidden($form->get('id')); echo $this->formRow($form->get('name')); echo $this->formRow($form->get('province')); echo $this->formRow($form->get('country')); echo $this->formRow($form->get('coordinate')); echo $this->formSubmit($form->get('submit')); echo $this->form()->closeTag(); ?> What I expected to see is a vertical form like this: But what i got is an ugly form like this: What's wrong with my code? Please help. EDIT: When I inspect element, the form generated is strange. The <input> element is inside the <label> element. <form id="city" name="city" method="post" action="/karciscus/public/admin/city/add"> <input type="hidden" value="" name="id"> <label> <span>Name</span><input type="text" value="" name="name"> </label> <label> <span>Province</span><input type="text" value="" name="province"> </label> <label> <span>Country</span><input type="text" value="" name="country"> </label> <label> <span> Coordinate</span><input type="text" value="" name="coordinate"> </label> <input type="submit" value="Save" id="submitButton" name="submit"> </form> I'm pretty sure it is the cause of my ugly rendered form. I think it is not supposedly like that. How to fix it?

    Read the article

  • Javascript clone form?

    - by user202987
    I need to copy a form information with all types of elements and send it with AJAX. Tried these: 1. cloneNode on the form. - Doesn't work with IE, only copies text stuff properly. cloneNode on each element. Doesn't work with IE, only copies text stuff properly. Making new textareas for each element, and copying the value in. Doesn't work for textareas in IE, formatting is lost. I imagine a combination of those 3 would work for IE and FF but is there any decent solution to this? Shortness of code is a priority.

    Read the article

  • Posting form using javascript and json with nested objects

    - by Tim
    I have an html form that has the following structure: <input type="text" name="title" /> <input type="text" name="persons[0].name" /> <input type="text" name="persons[0].color" /> <input type="text" name="persons[1].name" /> <input type="text" name="persons[1].color" /> I would like to serialize this into the following json: { "title":"titlecontent", "persons":[ { "name":"person0name", "color":"red" }, { "name":"person1name", "color":"blue" } ] } Notice that the number of persons can vary from case to case. The structure of the html form can change, but the structure of the submitted json can't. How is this done the easiest?

    Read the article

  • Pass form object value to static method

    - by jrubengb
    Hi, I need to take a form object value and pass it into a static method: public void SetCalendarStartSafe(DateTime startDateSafe) { startDateSafe = calendarStart.Value; } private static DataTable GetData() { frmMain frm = new frmMain(); DateTime startDate = new frmMain(); frm.SetCalendarStartSafe(startDate); } However I keep getting today's current date whenever I try this approach, even if the specified calendar date on the form is different. How can I can the user-specified calendar date from the original frmMain object? Thanks in advance for any guidance.

    Read the article

  • converting a form from text to textarea

    - by David Cook
    I have a form created to pull PHP values into my database. I created the form with all type="text" constructions. What follows is the code that used to set up the input of data and confirmed that it is functional. <label>About Me: <input type="text" name="BIO_info"/></label> I converted the input to a textarea and adjusted some parameters for proper display. Unfortunately, it has broken the ability for the script to function. What follows is the code I wrote to convert and store from a text area input. <label for="BIO_info" style=" margin-bottom: 500px; margin-top: 2000px; ">About Me: <textarea name="BIO_info" rows="20" cols="60" style="resize: none; overflow-y: hidden;vertical-align:middle;"></textarea> <p> I would appreciate any suggestions.

    Read the article

  • How to display records below form on submission in php without the use of database?

    - by OM The Eternity
    I have a form with multiple fields in it along with a image input field, just below the form i have a list to be displayed on every submit of this form... this has to be done without the use of DB.. I think this can be achieved by using session but its not working with me, as evrytime page gets refreshed and session gets recreated/reset.. Please help me in resolving this issue

    Read the article

  • Zend Form - How to set values on sub form elements?

    - by Zend_Sklave
    array 'subQuantity' => array 'quantity_6' => string '23' (length=2) 'quantity_16' => string '23' (length=2) 'quantity_18' => string '23' (length=2) 'update' => string 'Update' (length=6) Good day! I just created a subform from my existing zend form and procures this data when form submits. Based on posted data (the quantity_ elements), I would like to set the values to subform elements. Is it possible? Thanks in advance. cheers and happy coding!

    Read the article

  • Tracking form abandonment

    - by Alec Sanger
    I'm looking for a decent way to track form abandonment. Ideally, I would like to see how many people start filling out a form but do not complete it, as well as the last field that was filled out. The website is a fairly large Wordpress site with quite a few forms. Some of these forms are to register for events, some are for donations, some are for information requests. My first attempt at this was adding a generic jquery that bound functions to all forms on the site. When a form element was blurred, I would trigger a Google Analytics event with the name of the form, the name of the field, and whether or not it was filled. I expected to be able to go to the Event Flow section in Google Analytics and see the flow of these form events, however since there are so many forms and other events occurring on the website, Google wouldn't let me break them out very well. The other issue was the Quform doesn't name their fields anything relevant, and it doesn't look like we can name them ourselves. This results in a lot of ugly form names that don't mean anything without cross-referencing the actual form. Does anybody have any suggestions on how I can achieve more usable form abandonment metrics in a scenario like this?

    Read the article

  • How to detect if Asp.Net form is valid

    - by Hasan Gürsoy
    Hi, I have a form which is in an updatePanel and I have a span with hidden loading image, which I want to show when user clicks to submit button but I first need to check if page is valid on client side. Also I'm making loading span visible with jQuery. Here is my code: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> function showLoading() { $('#loader').show(); } </script> </head> <body> <asp:ScriptManager ID="smMain" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="upForm" runat="server"> <ContentTemplate> <asp:MultiView ID="mvContact" runat="server" ActiveViewIndex="0"> <asp:View ID="vDefault" runat="server"> <asp:TextBox ID="tEMail" runat="server" CssClass="input" /> <asp:RequiredFieldValidator ID="rfvEMail" runat="server" ControlToValidate="tEMail" ErrorMessage="* required" Display="Dynamic" /> <asp:RegularExpressionValidator ID="revEMail" runat="server" ControlToValidate="tEMail" ErrorMessage="* invalid" Display="Dynamic" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" /> <asp:ImageButton ID="btnSubmit" runat="server" ImageUrl="~/Assets/Images/btnSubmit.png" ToolTip="Submit Form" style="margin:5px 5px 0 -5px" onclick="btnSubmit_Click" OnClientClick="showLoading();" /> <span id="loader"><img src="Assets/Images/loader.gif" title="Sending..." /></span> </asp:View> <asp:View ID="vResult" runat="server"> <div class="result"> <span id="lResult" runat="server">Your message is sent</span> </div> </asp:View> </asp:MultiView> </ContentTemplate> </asp:UpdatePanel> </body></html>

    Read the article

  • PHP contact form overwrite fields issue repeating value

    - by judi
    H I'm using php contact form from http://phpfmg.sourceforge.net/home.php. I thought I'd add an onfocus effect so when i click in the fields the value dissappears automatically. But when I submit say if haven't filled in my requried fields I get this the values appearing again like <input type="text" class="text_box" onfocus="if(this.value=='Telephone')this.value='';" value="TelephoneTelephone" id="field_5" name="field_5">

    Read the article

  • Reorder inputs before submiting form

    - by Jason
    Is there any way to reorder or manipulate a set of inputs before posting to a script for processing? I'm able to reorder the elements in the DOM no problem, but getting this to happen after the user presses the submit button and before the browser makes the POST is a bit tricky. I'm using the ajaxForm plugin in jQuery. There is a beforeSubmit callback, but this doesn't seem to allow me to reorded the inputs.

    Read the article

  • Problem with jquery ajax form on Codeigniter

    - by Code Burn
    Everytime I test the email is send correctly. (I have tested in PC: IE6, IE7, IE8, Safari, Firefox, Chrome. MAC: Safari, Firefox, Chrome.) The _POST done in jquery (javascript). Then when I turn off javascript in my browser nothing happens, because nothing is _POSTed. Nome: Jon Doe Empresa: Star Cargo: Developer Email: [email protected] Telefone: 090909222988 Assunto: Subject here.. But I keep recieving emails like this from costumers: Nome: Empresa: Cargo: Email: Telefone: Assunto: CONTACT_FORM.PHP <form name="frm" id="frm"> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Nome<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="Cnome" id="Cnome" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Empresa<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CEmpresa" id="CEmpresa" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Cargo</div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CCargo" id="CCargo" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Email<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CEmail" id="CEmail" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Telefone</div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CTelefone" id="CTelefone" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Assunto<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><textarea class="texto textocinzaescuro" name="CAssunto" id="CAssunto" rows="2" cols="28"></textarea></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >&nbsp;</div> <div class="campoFormulario inputDeCampo" style="text-align:right;" ><input id="Cbutton" class="texto textocinzaescuro" type="submit" name="submit" value="Enviar" /></div> </form> <script type="text/javascript"> $(function() { $("#Cbutton").click(function() { if(validarForm()){ var Cnome = $("input#Cnome").val(); var CEmpresa = $("input#CEmpresa").val(); var CEmail = $("input#CEmail").val(); var CCargo = $("input#CCargo").val(); var CTelefone = $("input#CTelefone").val(); var CAssunto = $("textarea#CAssunto").val(); var dataString = 'nome='+ Cnome + '&Empresa=' + CEmpresa + '&Email=' + CEmail + '&Cargo=' + CCargo + '&Telefone=' + CTelefone + '&Assunto=' + CAssunto; //alert (dataString);return false; $.ajax({ type: "POST", url: "http://www.myserver.com/index.php/pt/envia", data: dataString, success: function() { $('#frm').remove(); $('#blocoform').append("<br />Obrigado. <img id='checkmark' src='http://www.myserver.com/public/images/estrutura/ok.gif' /><br />Será contactado brevemente.<br /><br /><br /><br /><br /><br />") .hide() .fadeIn(1500); } }); } return false; }); }); function validarForm(){ var error = 0; if(!validateNome(document.getElementById("Cnome"))){ error = 1 ;} if(!validateNome(document.getElementById("CEmpresa"))){ error = 1 ;} if(!validateEmail(document.getElementById("CEmail"))){ error = 1 ;} if(!validateNome(document.getElementById("CAssunto"))){ error = 1 ;} if(error == 0){ //frm.submit(); return true; }else{ alert('Preencha os campos correctamente.'); return false; } } function validateNome(fld){ if( fld.value.length == 0 ){ fld.style.backgroundColor = '#FFFFCC'; //alert('Descrição é um campo obrigatório.'); return false; }else { fld.style.background = 'White'; return true; } } function trim(s) { return s.replace(/^\s+|\s+$/, ''); } function validateEmail(fld) { var tfld = trim(fld.value); var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ; var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ; if (fld.value == "") { fld.style.background = '#FFFFCC'; //alert('Email é um campo obrigatório.'); return false; } else if (!emailFilter.test(tfld)) { //alert('Email inválido.'); fld.style.background = '#FFFFCC'; return false; } else if (fld.value.match(illegalChars)) { fld.style.background = '#FFFFCC'; //alert('Email inválido.'); return false; } else { fld.style.background = 'White'; return true; } } </script> FUNCTION ENVIA (email sender): function envia() { $this->load->helper(array('form', 'url')); $nome = $_POST['nome']; $empresa = $_POST['Empresa']; $cargo = $_POST['Cargo']; $email = $_POST['Email']; $telefone = $_POST['Telefone']; $assunto = $_POST['Assunto']; $mensagem = " Nome:".$nome." Empresa:".$empresa." Cargo:".$cargo." Email:".$email." Telefone:".$telefone." Assunto:".$assunto.""; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: no-reply' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail('[email protected]', $mensagem, $headers); }

    Read the article

  • How do I create multiple submit buttons for the same form in Rails?

    - by Angela
    I need to have multiple submit buttons. I have a form which creates an instance of Contact_Call. One button creates it as normal. The other button creates it but needs to have a different :attribute value from the default, and it also needs to set the attribute on a different, but related model used in the controller. How do I do that? I can't change the route, so is there a way to send a different variable that gets picked up by [:params]? And if I do then, what do I do in the controller, set up a case statement?

    Read the article

  • SEO/PHP: How to Convert Form-Submit URL (Get-Method) without Javascript SEO-Friendly?

    - by elmas
    hello, i have this code <form action="index.php" method="get" class="search-form"><input type="text" size="35" name="search" class="searchBox" value="" /><input type="submit" value="Start Searching!" /></form> and actually i convert the url with javascript <script type="text/javascript"> $(document).ready(function() { $('.search-form').submit(function() { var value = $('.search-form input:text').val(); value = value = value.replace(/\W/,''); // replace window.location.href = value + "-keyword" + ".html"; return false; }); }); </script> is there a method to convert the url seo-friendly without javascript? maybe with php?

    Read the article

  • jQuery, array form radio button name problem.

    - by borayeris
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>click div to select hidden options</title> <script type="text/javascript" src="jquery-1.4.4.js"></script> <style type="text/css"> .clickDiv { width:50px; height:50px; cursor:crosshair; } .red {border:1px #000 solid;} .green {border:1px #000 solid;} .redBG {background:#F00;} .greenBG {background:#0F0;} </style> <script type="text/javascript"> $(function() { $('div.clickDiv.red').click(function(){ var secilenMadde=$(this).attr('madde'); $('div#write').text(secilenMadde); $('input[name='+secilenMadde+'][value=red]').attr('checked', 'checked'); $('div.clickDiv.red[madde='+secilenMadde+']').addClass('redBG'); $('div.clickDiv.green[madde='+secilenMadde+']').removeClass('greenBG'); }); $('div.clickDiv.green').click(function(){ var secilenMadde=$(this).attr('madde'); $('div#write').text(secilenMadde); $('input[name='+secilenMadde+'][value=green]').attr('checked', 'checked'); $('div.clickDiv.green[madde='+secilenMadde+']').addClass('greenBG'); $('div.clickDiv.red[madde='+secilenMadde+']').removeClass('redBG'); }); }); </script> </head> <body> <div id="write"></div> <form id="formId" name="formName" method="post"> <table> <tr> <td><div class="clickDiv red" madde="line1"></div></td> <td><div class="clickDiv green" madde="line1"></div></td> </tr> <tr> <td><div class="clickDiv red" madde="line2"></div></td> <td><div class="clickDiv green" madde="line2"></div></td> </tr> </table> <label for="line1red"><input id="line1red" type="radio" name="line1" value="red" /> Red</label> <label for="line1green"><input id="line1green" type="radio" name="line1" value="green" /> Green</label><br /> <label for="line2red"><input type="radio" name="line2" value="red" /> Red</label> <label for="line2green"><input type="radio" name="line2" value="green" /> Green</label> </form> </body> </html> This works. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>click div to select hidden options</title> <script type="text/javascript" src="jquery-1.4.4.js"></script> <style type="text/css"> .clickDiv { width:50px; height:50px; cursor:crosshair; } .red {border:1px #000 solid;} .green {border:1px #000 solid;} .redBG {background:#F00;} .greenBG {background:#0F0;} </style> <script type="text/javascript"> $(function() { $('div.clickDiv.red').click(function(){ var secilenMadde=$(this).attr('madde'); $('div#write').text(secilenMadde); $('input[name='+secilenMadde+'][value=red]').attr('checked', 'checked'); $('div.clickDiv.red[madde='+secilenMadde+']').addClass('redBG'); $('div.clickDiv.green[madde='+secilenMadde+']').removeClass('greenBG'); }); $('div.clickDiv.green').click(function(){ var secilenMadde=$(this).attr('madde'); $('div#write').text(secilenMadde); $('input[name='+secilenMadde+'][value=green]').attr('checked', 'checked'); $('div.clickDiv.green[madde='+secilenMadde+']').addClass('greenBG'); $('div.clickDiv.red[madde='+secilenMadde+']').removeClass('redBG'); }); }); </script> </head> <body> <div id="write"></div> <form id="formId" name="formName" method="post"> <table> <tr> <td><div class="clickDiv red" madde="line[1]"></div></td> <td><div class="clickDiv green" madde="line[1]"></div></td> </tr> <tr> <td><div class="clickDiv red" madde="line[2]"></div></td> <td><div class="clickDiv green" madde="line[2]"></div></td> </tr> </table> <label for="line1red"><input id="line1red" type="radio" name="line[1]" value="red" /> Red</label> <label for="line1green"><input id="line1green" type="radio" name="line[1]" value="green" /> Green</label><br /> <label for="line2red"><input type="radio" name="line[2]" value="red" /> Red</label> <label for="line2green"><input type="radio" name="line[2]" value="green" /> Green</label> </form> </body> </html> This doesn't. I need input names as an array but it breaks my script. Why?

    Read the article

  • jquery events on input submit fields

    - by dfilkovi
    I have a problem with jquery submit button onclick and default event. What I want to do is replace an click event on submit button if it has one, and get an dialog box to show up, on clicking yes the dialog should start that default onclick event if submit button has one defined, if it hasn't than the default event should happen (button submits form), .submit() function does not work for me in any case cause I need to send this button also through a form and if button wasn't clicked .submit() sends form data without submit data. Bellow code has a problem, alert('xxx') is always called and it shouldn't, and on clicking yes button alert and dialog creation is called again, also if I remove alert button, I cannot call default submit button event (form submitting with a button). $('input.confirm').each(function() { var input = this; var dialog = document.createElement("div"); $(dialog).html('<p>AREYOUSHURE</p>'); $(input).click(function(event) { event.preventDefault(); var buttons = {}; buttons['NO'] = function() { $(this).dialog("close"); }; buttons['YES'] = function() { $(input).trigger('click'); $(this).dialog("close"); }; $(dialog).dialog( { autoOpen: false, width: 200, modal: true, resizable: false, buttons: buttons }); $(dialog).dialog('open'); return false; }); }); <form method="post" action=""> <input type="hidden" value="1" name="eventId" /> <input type="submit" value="Check" name="checkEvent" class="confirm" onclick="alert('xxx');" /> </form>

    Read the article

  • Setting "submit"

    - by user361626
    Driving me a bit nuts this one, have tried alsorts of combination's... At the top of my file I have PHP Code: if (!ISSET ($_POST['submit'])) which tests if the submit has been hit, if not displays the form.... What I'd like to be able to to is generate a link that would be processed directly by the php code that the form would normally be submitted to... (does that make sense ?) so a generated link in the code looks like .. PHP Code: echo '<a href="index.php?submit&s_type=' . $s_type . '&d_height=' . $d_height . '&j_ref=' . $j_ref . '&j_name=' . j_name . '">' . $j_ref . '</a>'; The link generated looks like .. HTML Code: index.php?s_type=partk&d_height=3312&j_ref=AS0001&j_name=j_name I have tried setting "submit" with links like HTML Code: index.php?submit=submit&s_type=partk&d_height=3312&j_ref=AS0001&j_name=j_name index.php?submit&s_type=partk&d_height=3312&j_ref=AS0001&j_name=j_name How do I create a link that sets "submit so it gets processed rather than going through the form ???

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >