In Zend Framework how can I set the title properties of option elements within a select?
Desired output:
<option value="foo" title="bar">option</option>
i tired and was unable to find the answer i am looking for an answer. my problem is that i am unable to update the values enterd in the form. I have attached all the files i'm using MYSQL database to fetch data.
what happens is that i'm able to add and delete records from form using jquery and PHP scripts to MYSQL database, but i am not able to update data which was retrived from database. the file structure is as follows
index.php is a file with jquery functions where it displays form for adding new data to MYSQL using save.php file and list of all records are view without refrishing page (calling load-list.php to view all records from index.php works fine, and save.php to save data from form)
- Delete is an function called from index.php to delete record from mysql database (function calling delete.php works fine)
- Update is an function called from index.php to update data using update-form.php by retriving specific record from mysql tabel, (works fine)
Problem lies in updating data from
update-form.php to update.php (in
which update query is wrriten for
mysql)
i had tried in many ways at last i had figured out that data is not being transfred from update-form.php to update.php there is a small problem in jquery ajax function where it is not transfering data to update.php page. some thing is missing in calling update.php page it is not entering into that page
I am new bee in programming i had collected this script from many forums and made this one.So i was limited in solving this problem i cam to know that this is good platform for me and many where we get a help to create new things..
please guide me with your help to complete my effors !!!!! i will be greatfull to all including ths site which gave me an oppurtunity to present my self..... please find the link below to download all files which is of 35kb (virus free assurance)
download mysmallform files in ZIPped format, including mysql query
thanks a lot in advance, May GOD bless YOU and THIS SITE
I am wanting to use the Facebox plugin for JQuery but am having a few issues getting it running how I want. The div that houses the facebox content is created outside of the tag so even though I am loading up some web controls none of them are firing back to the server.
Has anyone dealt with this that can give me some pointers?
Hi all,
maybe my design is not good, or I don't see the obvious solution, but I want to subscribe to a buttonClick EventHandler of Form1 from outside form1.
For example I have a Controller and Form1 who are both instanced in the main function.
Now I want to subscribe a function from Controller to the buttonClick event from Button1_Click in Form1. But the button1 is declarded private, so i can't do
form1->Button1->Click += gcnew EventHandler(controller->function)
Is there any way to get around this?
Ok I could write a setter or something in Form1, but is there any other solution?
I read some examples, but they are all calling events from within the same class so they don't address my specific problem.
Hey guys..
I basically have several links on the left side of the screen and on the right is a preview window. Below the preview window is another box for the affiliate link code. So what I am trying to do is create an affiliate page where you choose the banner size on the left by clicking on the link and on the right you see it dynamically change to the banner size and the code changes accordingly as well. So far I have the following code and it works but it seems very very cumbersome and bloated. Can you see if I can trim this down?
jQuery(".banner-style li").click(function() {
jQuery(".banner-style li").removeClass("selected");
jQuery(this).addClass("selected");
var $banner = jQuery(this).attr("class");
$banner = $banner.replace(" selected","");
jQuery(".preview img").fadeOut('fast',function() {
jQuery(".preview img").attr("src",
"http://localhost/site/banners/"+$banner+".jpg")
.fadeIn('slow');
});
jQuery(".code p").removeClass('hide').hide();
jQuery(".code p."+$banner).show();
});
Also to note the funny thing is in FF, when you click for the first to on any link, the original image on the right fades out and in real quick and then it loads the "clicked" image. This does not happen in other browsers...
I have grid control
select
<%--Select--%
</ItemTemplate>
</asp:TemplateField>
</columns>
<pagersettings mode="NumericFirstLast" position="Top" pagebuttoncount="5" />
<pagerstyle backcolor="Pink" />
</cc:AppEngineGridView>
my code on row create
protected override void OnRowCreated(GridViewRowEventArgs e)
{
try
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.ID = this.ID + "_" + e.Row.RowIndex;
e.Row.Attributes.Add("onmouseover", "this.style.cursor='pointer';this.style.font.weight='bolder';");
e.Row.Attributes.Add("onclick", "DoNav('" + ((LinkButton)e.Row.FindControl("lbtn1")).ClientID + "');");
}
}
protected void grduser_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
grdview_RowClickCommand(sender, e);
}
Javascript :
function DoNav(id)
{
$("#"+id).click();
}
Now my question is when i click on the row it do post back but it didnt call rowupdate event
How can do this i.e using javascript to call row update command of the grid.
what is the code if you want that only number should be inputted in an html textbox.
If you input letters there will be no letter that would show. If you input numbers, the numbers would show, please help
I want to load the image URL from my NSMutableArray.
Here is my Code:
id path = (NSString *)[[stories objectAtIndex: storyIndex] objectForKey: @"icon"];
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data cache:NO];
If I use: id path = @"http://www.xzy.de/icon.png"; it´s all right, but not if I want to extract the imageURL from my Array
Anyone who can help me?
Thanks!
I have the following in an initializer in a rails app that uses Twitter bootstrap so that it removes the div.field_with_errors that rails applies when validation fails on a field but also the initializer adds the help/validation text after the erroneous input field:
require 'nokogiri'
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
html = %(<div class="field_with_errors">#{html_tag}</div>).html_safe
form_fields = [
'textarea',
'input',
'select'
]
elements = Nokogiri::HTML::DocumentFragment.parse(html_tag).css("label, " + form_fields.join(', '))
elements.each do |e|
if e.node_name.eql? 'label'
html = %(#{e}).html_safe
elsif form_fields.include? e.node_name
if instance.error_message.kind_of?(Array)
html = %(#{e}<span class="help-inline"> #{instance.error_message.join(',')}</span>).html_safe
else
html = %(#{e}<span class="help-inline"> #{instance.error_message}</span>).html_safe
end
end
end
html
end
This works fine but I also need to apply the .error class to the surrounding div.control-group for each error.
My initializer currently gives the following output:
<div class="control-group">
<label class="control-label" for="post_message">Message</label>
<div class="controls">
<input id="post_message" name="post[message]" required="required" size="30" type="text" value="" /><span class="help-inline"> can't be blank</span>
</div>
</div>
but I need something adding to my initializer so that it adds the .error class to the div.control-group like so:
<div class="control-group error">
<label class="control-label" for="post_message">Message</label>
<div class="controls">
<input id="post_message" name="post[message]" required="required" size="30" type="text" value="" /><span class="help-inline"> can't be blank</span>
</div>
</div>
The solution will probably need to allow for the fact that each validation error could have more than one label and input that are all within the same div.control-group (eg radio buttons / checkboxes / 2 text fields side by side).
I assume it needs some sort of e.at_xpath() to find the div.control-group parent and add the .error class to it but I'm not sure how to do this.
Can anyone help?
PS This may all be possible using the formtastic or simple_form gems but I'd rather just use my own html if possible.
EDIT
If I put e['class'] = 'foo' in the if e.node_name.eql? 'label' section then it applies the class to the label so I think I just need to find the parent tag of e and then apply an .error class to it but I can't figure out what the xpath would be to get from label to its div.control-group parent; no combination of dots, slashes or whatever seems to work but xpath isn't my strong point.
Im building an ad-system where users can dynamically create 'fields' for each ad type.
My models and example values:
AdType:
| id | name
|----|-----
| 1 | Hotel
| 2 | Apartment
AdOption:
| id | ad_type_id | name
|----|------------|-----
| 1 | 1 | Star rating
| 2 | 1 | Breakfast included?
| 3 | 2 | Number of rooms
AdValue: (Example after saving)
| id | ad_id | ad_option_id | value
|----|-------|---------------|------
| 1 | 1 | 1 (stars) | 5
| 2 | 1 | 2 (breakfast) | true
Ad: (Example after saving)
| id | description | etc....
|----|-----------------|--------
| 1 | very nice hotel | .......
So lets say I want to create a new ad, and I choose Hotel as the ad type.
Then I need my view to dynamically create fields like this: (I'm guessing?)
[Label] Star rating:
[hidden_field :ad_id] [hidden_field :ad_option_id] [text_field :value]
[Label] Breakfast included?
[hidden_field :ad_id] [hidden_field :ad_option_id] [text_field :value]
And also, how to save the values when the ad record is saved
I hope this is understandable. If not just ask and I'll try to clarify.
I need to develop a simpleform (intended only for printing) to be filled in by arbitrary end users (i.e. no specialized software). Ideally, I'd like the end-user to be able to save their inputs to the form and update it periodically. It seems that (at least without LiveCycle Enterprise Suite) Adobe Reader won't save data input in a PDF form. Aside from just distributing the form as a Word document, does anyone have any suggestions?
Background:
I do some work for a volunteer ambulance corps. They have a lot of elderly patients who don't know (or can't remember) their medical history. They want to develop a common form with personal information (name, address, DOB, medications list, etc.) for elderly residents to hang on their refrigerators (apparently a common solution to this problem). As some of them (or their children/grandchildren) are computer literate, it would make most sense to provide a download-able blank form that can be filled in, saved, updated, and re-printed as needed. Due to worries about privacy, HIPAA, etc. anything with server-side generation is out, it needs to be 100% client-side, and in a format that the majority of non-technical computer users can access without additional software.
Thanks for any tips... at this point, I'm leaning towards just using a .doc form.
I'm trying to convert a preexisting javascript function into a jQuery function.
The function comes from http://javascript.internet.com/forms/zip-to-state.html
and aims to convert a user-entered zip code into a state. I'm using jQuery 1.3.2, with all the necessary plugins, but I'm not very familiar with jQuery syntax and how to convert this from plain ol' Javascript syntax.
The setState function takes two parameters, the zip code element and the state element, so I'm trying to do something like this:
$('$zip_code').change( function () { setState($(this), $('#state')); });
Any thoughts on this syntax? Thanks, Dakota
function getState(zip) {
if ((parseInt(zipString.substr(zip / 4, 1), 16) & Math.pow(2, zip % 4)) && (zip.length == 5))
for (var i = 0; i < stateRange.length; i += 7)
if (zip <= 1 * stateRange.substr(i, 5))
return stateRange.substr(i + 5, 2);
return null;
}
function setState(txtZip, optionBox) {
if (txtZip.value.length != 5 || isNaN(txtZip.value / 4)) {
optionBox.options[0].selected = true;
alert("Please enter a 5 digit, numeric zip code.");
return;
}
var state = getState(txtZip.value);
for (var i = 0; i < optionBox.options.length; i++)
if (optionBox.options[i].value == state)
return optionBox.options[i].selected = true;
for (var i = 0; i < optionBox.options.length; i++)
if (optionBox.options[i].value == "XX")
return optionBox.options[i].selected = true;
}
Can Any One explain this Language how we converted to CFG
Give a CFG for the CFL: {ai bj ck | i ? j or j ? k } //ai mean a^i
I have the answer but I need an explaination (Step By Step)
The answer :
S --> S1|S2
S1 --> A Eab|Eab B|S1 c
A --> a|aA B--> b|bB
Eab --> Q|a Eab b
S2 --> Eac C|A Eac
C --> c|cC
Eac --> Q|B|a Eac c
I have a SQL 2008 table with a field called RecDate of type DateTimeOffset.
For a given record the value is '2010-04-01 17:19:23.62 -05:00'
In C# I create a DataTable and fill it with the results of "SELECT RecDate FROM MyTable".
I need to get the milliseconds, but if I do the following the milliseconds are always 0:
DateTimeOffset dto = DateTimeOffset.Parse(dt.Rows[0][0].ToString());
What is the proper way to get the value in the RecDate column into the dto variable?
Thanks!
Darvis
hi
What options/properties should use to show a main from scrolbars when I want to?
or always visible in Delphi 2010
The help is as too often useless
thanks
Pw
Hi i am having the follow code
<div id="container">
<div class="element NOTME"></div>
<div class="element"></div>
<div class="element"></div>
<div class="element"></div>
</div>
the code below select the inputs inside container with class element
$("#container .element input[name^='myname']").each
How can i rewrite the above code (the selector actually) that will exclude when has class NOTME
Thanks
My send mail task works fine for email ids like [email protected] but it throws error for email ids like [email protected].
is there any way i can make it work for such ids also?
Thanks.
Hi, im using C# dll in VC++ application.I have somedetails in VC++ like
PageNumer
pageTitle
PageDesc
BoxDetail
I have to pass this to C# Dll.
So i made one structure in VC++,then i pas that to C#.But i could't do that.Pls help mw.
VC++ Function:
struct SCS3OverVwPg
{
__int32 iOvrPgNo;
char sOvrPgTitle[30]; //OverView Page Title
};
void CToolTab::SendOverview()
{
SCS3OverVwPg *pOverVw = 0;
pOverVw = new SCS3OverVwPg;
Globals1::gwtoolbar->SetTree(pOverVw);
}
C# function:
public struct SCS3Over
{
Int32 iOvrPgNo;
char[] sOvrPgTitle;
}
public void SetTree(SCS3Over x)
{
MessageBox.Show("Data received");
}
If i do like this,it shows error
error C2664: 'Tabcontrol::ToolBar::SetTree' : cannot convert parameter 1 from 'SCS3OverVwPg *' to 'SCS3Over'
IF i change name in C# dll to SCS3OverwPg,
it show error of structure redifinition
Pls help me.
Hi,
I wrote a AS3 script, i have 2 fields to validate, i.e email and name.
For email i use:
function isValidEmail(Email:String):Boolean {
var emailExpression:RegExp = /^[a-z][\w.-]+@\w[\w.-]+.[\w.-]*[a-z][a-z]$/i;
return emailExpression.test(Email);
}
How about name field? Can you show me some sample code?
EDIT:
Invalid are:
blank
between 4 - 20 characters
Alphanumeric only(special characters not allowed)
Must start with alphabet
Hi, I can connect to the access database and run functions etc from c#, I can even get a hold of the button I need to click, but I can't make it think it's been clicked.
nonManagedDb.DoCmd.OpenForm("frmMaintenance", Access.AcFormView.acNormal, MissingVal, Access.AcFormOpenDataMode.acFormReadOnly, Access.AcWindowMode.acWindowNormal, MissingVal);
var RunRep = (CommandButton)nonManagedDb.Forms["frmMaintenance"].Controls["btnDailySheetsReport"];
That's as afar as I've gotten with this, I've tried reflection to grab it's event and invoke it but it's classed as a COM object only so that's out.
I'm using Zend_Navigation to create my nav. I want the URL to be domain.com/me and not domain.com/index/me. What is wrong with my config XML:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<nav>
<home>
<label>Home</label>
<controller>index</controller>
<action>index</action>
<pages>
<me>
<label>Me</label>
<module>default</module>
<controller>index</controller>
<action>me</action>
<resource>user</resource>
<privilege>logout</privilege>
</me>
</pages>
</home>
</nav>
</config>
Hi,
I get the following error when I try to validate a contact page on my site:
document type does not allow element "script" here
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
I am using Joomla 1.5.7, and the doctype is
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Any idea how to fix this?
Hi
I have a submit button and am styling it using the following css:
.subm
{
background-color:Transparent;
background-image:url(Images/Button_Send.png);
background-repeat:no-repeat;
width:82px;
height:30px;
display:block;
border:none;
outline:none;
overflow:visible;}
.subm:hover
{
background-color:Transparent;
background-image:url(Images/Button_Send_Over.png);
background-repeat:no-repeat;
width:82px;
height:30px;
display:block;
border:none;
outline:none;
overflow:visible;
}
Here is the html:
<input type="submit" class="subm" value="" />
Nothing surprising. However, what annoys me is that when the submit button is clicked in IE it moves the image up a couple of pixels cutting them off which makes it look, hmm, good word, 'naff.' How can I compensate or stop this?
I have tried expanding the image and leaving a couple of blank pixels at the top but it still does the same thing!
Thanks R.
A co-worker of mine had downloaded a vb example project a while back to see how to make a call or two, he discovered it today again, and noticed that while sitting in the IDE the time/date is updating automatically when the entire project is not even running.
How does this work, we looked around for code but can't find anything giving it away.
Any ideas?
I have a Rails app that lets users create tutorials and quizzes. There are many users taking the quizzes and many quizzes in a tutorial. My client wants the quiz results to persist when a student navigates away from the quiz. So the use case would be:
User starts to take quiz
User answers some of the questions
User navigates away from quiz to check a fact in the tutorial
User goes back to quiz and their answers are still there
User finishes quiz and submits
Now this would be pretty easy to do if I enforced a "Save" submit so that the answers could be stored in a session or whatever, but the client (and I agree) thinks people will not remember to save before navigating away.
Looking for advice on how to approach this. I'm thinking an observer and cookies.